Open zygoloid opened 1 month ago
The decision to add this to -Wall
and deviate from GCC was explicit: https://discourse.llvm.org/t/rfc-diagnosing-use-of-vlas-in-c/73109
But you're right that -pedantic-errors
should catch this and it's not: https://godbolt.org/z/Mh4oKb8rf
This regressed between Clang 17 and Clang 18 as a result of 84a3aadf0f2483dde0acfc4e79f2a075a5f35bd1 (7339c0f782d5c70e0928f8991b0c05338a90c84c)
Testcase:
Compiling this invalid code in C++ mode with
-Wall -pedantic-errors
should give an error. But it doesn't, it just produces a warning.It seems that the fact that
-Wvla-cxx-extension
is in-Wall
is breaking-pedantic-errors
. Replacing-pedantic-errors
with-Werror=pedantic
works properly, which is odd since-pedantic-errors
is supposed to imply-Werror=pedantic
.(Including this warning in
-Wall
seems like a strange choice; it's not in GCC's-Wall
and doesn't seem like the kind of thing that-Wall
usually warns about.)