Closed OCHyams closed 1 year ago
@llvm/issue-subscribers-c
@llvm/issue-subscribers-clang-frontend
Hi! This isn't a bug, it's a C++2b (tentatively C++23) and C2x (tentatively C23) feature: https://github.com/cplusplus/papers/issues/1006
even though -std=c17 is specified in the example
Clang backports most of the features of more recent standards to all possible standards (with warnings) if it doesn't break important things.
If you want to forbid backporting features of the more recent standard, you can use -Werror=c2x-extensions
flag
This behavior is by design, closing as not a bug.
Ok, thanks for the info!
Btw, the reference to the C paper for this feature is: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf
With this test case
test.c
:Before D133887 we got an error:
With D133887 we just get a warning:
I'm not very familiar with the C standard but it seemed suspicious that this error has become a warning even though
-std=c17
is specified in the example. Is this a bug?Also see on compiler explorer with clang-15 vs trunk.
cc @cor3ntin and @Izaron from D133887.