Open llvmbot opened 4 years ago
(But see also bug 47693 comment 1: -Werror=c99-designator
isn't enough at the moment to turn off all the C99-but-not-C++20 cases.)
Clang intentionally accepts the full C99 designated initializer syntax in C++ as a longstanding language extension (predating C++20 designated initialization).
If you want this extension to be disabled, you can use -Werror=c99-designator
.
If you want all such extensions disabled, you can use -pedantic-errors
.
I believe C does allow these.
Does C allow these? It's been too long, I can't remember the details.
Extended Description
Hi,
This code snippet is taken from P0329R4.
GCC fails to compile this example, which should be invalid according to the C++20 standard.
GCC error: