[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

Ding Fei via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 15 17:39:22 PDT 2024


================
@@ -13805,29 +13804,24 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) {
     // OpenCL v1.2 s6.5.3: __constant locals must be constant-initialized.
     // This is true even in C++ for OpenCL.
     } else if (VDecl->getType().getAddressSpace() == LangAS::opencl_constant) {
-      CheckForConstantInitializer(Init, DclT);
+      CheckForConstantInitializer(Init);
----------------
danix800 wrote:

No, this defaults to `diag::err_init_element_not_constant`.

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


More information about the cfe-commits mailing list