================ @@ -8857,7 +8894,9 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) { if (NewVD->isConstexpr() && !T->isDependentType() && RequireLiteralType(NewVD->getLocation(), T, - diag::err_constexpr_var_non_literal)) { + getLangOpts().C23 + ? diag::err_c23_constexpr_invalid_type + : diag::err_constexpr_var_non_literal)) { ---------------- cor3ntin wrote:
`RequireLiteralType` assumes C++ (ie it will cast to CXXRecordDecl), so maybe we need to duplicate that entirely. Maybe just renaming `CheckC23ConstexprVarTypeQualifiers` to `CheckC23ConstexprVarType` and do the VLAs test there https://github.com/llvm/llvm-project/pull/73099 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits