================ @@ -1114,7 +1114,8 @@ def VexingParse : DiagGroup<"vexing-parse">; def VLAUseStaticAssert : DiagGroup<"vla-extension-static-assert">; def VLACxxExtension : DiagGroup<"vla-cxx-extension", [VLAUseStaticAssert]>; def VLAExtension : DiagGroup<"vla-extension", [VLACxxExtension]>; -def VLA : DiagGroup<"vla", [VLAExtension]>; +def VLASizeConfusion : DiagGroup<"vla-potential-size-confusion">; ---------------- rapidsna wrote:
> Okay, let's see if we're converging on our next steps. :-) > > We'd like two diagnostics, they don't have to be done in the same PR. > > One diagnostic is `-Wchanges-meaning` and it only is enabled by > `-fexperimental-late-parse-attributes` or `-fbounds-safety` and only triggers > on the attribute case where meaning is actually changed today. This is > intended to help bounds safety users see where the extension is changing the > default lookup rules of the language. > > The other diagnostic is harder to name, but it's disabled by default and when > enabled points out scenarios where the use of a name within a parameter list > could be confusing. We expect this to be focused on array size specifiers and > attribute arguments, but other scenarios within a parameter list could be > supported if we found a need. It should not trigger outside of parameter > lists. We might add related diagnostics for other contexts later. > > Does that seem about right? Yes, this sounds about right. Thank you! One suggestion though: even if arrays and attributes share the same underlying diagnostic mechanism, I'd recommend keeping `-Wname-confusion-array-sizes` (or whichever name we decides) focused solely on array size specifiers, which is what matters most right now anyway. Attribute arguments should have their own separate warning group (e.g. -Wname-confusion-attributes). Otherwise, attributes could conflate with things like guarded_by, and as the scope grows it becomes harder to define what "name confusion in the core language" this warning group is actually meant to cover. One other thing to flag for C++: guarded_by-like attributes already do late parsing by default in C++, without requiring `-fexperimental-late-parse-attributes`. So diagnosing name confusion in those attributes should always fall under `-Wchanges-meaning` rather than the new group. https://github.com/llvm/llvm-project/pull/181550 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
