[clang] [Clang][OpenMP] Fix crash on a `braced-init-list` in the `init` or increment of a transformed loop (PR #233248)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 19 03:46:20 PDT 2026


================
@@ -8674,6 +8674,20 @@ static const StmtExpr *findStmtExpr(const Expr *E) {
   return nullptr;
 }
 
+static ExprResult buildInitListValue(Sema &SemaRef, Expr *E) {
+  auto *ILE = dyn_cast<InitListExpr>(E);
+  if (!ILE)
+    return E;
+  if (ILE->isTransparent())
+    return buildInitListValue(SemaRef, ILE->getInit(0));
+  if (ILE->getNumInits() != 0 || !ILE->getType()->isScalarType())
+    return E;
+  SourceLocation Loc = ILE->getLBraceLoc();
+  return SemaRef.BuildCStyleCastExpr(
+      Loc, SemaRef.Context.getTrivialTypeSourceInfo(ILE->getType(), Loc), Loc,
+      SemaRef.ActOnIntegerConstant(Loc, 0).get());
----------------
alexey-bataev wrote:

No, it should be implicit conversion, not a c-style

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


More information about the cfe-commits mailing list