[clang] [Clang] disallow constexpr with auto and explicit type in C23 (PR #163469)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 15 01:00:14 PDT 2025
================
@@ -62,6 +62,8 @@ auto basic_usage(auto auto) { // c23-error {{'auto' not allowed in function pr
int auto_cxx_decl = auto(0); // expected-error {{expected expression}}
+ constexpr auto int x = 0; // c23-error {{cannot combine with previous 'auto' declaration specifier}} \
----------------
Fznamznon wrote:
Can we add a test (if not yet existent) that does
```
constexpr int auto y = 9;
```
https://github.com/llvm/llvm-project/pull/163469
More information about the cfe-commits
mailing list