[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


================
@@ -1369,7 +1369,7 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
 
   if (S.getLangOpts().C23 &&
       getConstexprSpecifier() == ConstexprSpecKind::Constexpr &&
-      StorageClassSpec == SCS_extern) {
+      (StorageClassSpec == SCS_extern || StorageClassSpec == SCS_auto)) {
----------------
Fznamznon wrote:

Shouldn't we also check that a type specifier was also provided?

https://github.com/llvm/llvm-project/pull/163469


More information about the cfe-commits mailing list