MitalAshok wrote:
Previous diagnostics for `constexpr int x = 1;`
<https://godbolt.org/z/WGT1o1or4>:
```
<source>:1:1: warning: 'constexpr' is incompatible with C standards before C23
[-Wpre-c23-compat]
1 | constexpr int x = 1;
| ^
<source>:1:1: warning: 'constexpr' specifier is incompatible with C++98
[-Wc++98-compat]
<source>:1:15: warning: unused variable 'x' [-Wunused-const-variable]
1 | constexpr int x = 1;
| ^
```
The C++98 warning is bogus; I've replaced it with one that says "C standards
before C23" and removed the first warning (since it's about the token and not
the specifier on a declaration, for if `constexpr` is expanded in meaning in
C2y or later)
https://github.com/llvm/llvm-project/pull/199537
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits