================ @@ -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:
> -Wchanges-meaning is good as @uecker suggested. `-Wchanges-meaning` is related but I don't think it's the right fit here. `-Wchanges-meaning` is about cases where the presence of a class member actually changes the meaning of a name — the name resolves to something different. In this case, the presence of parameter n doesn't change the meaning of `arr[n];` it still refers to the global `n`. It's more about catching a likely programmer mistake where they probably intended to use the parameter `n` as the array size instead. ```C int n; void foo(int arr[n], int n); // arr[n] refers to global `n`, but it's likely a programmer mistake ``` https://github.com/llvm/llvm-project/pull/181550 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
