[clang] [clang][Sema] Expand `#embed` in braced lists that initialize non-aggregates (PR #231938)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 18 19:46:02 PDT 2026


================
@@ -13589,9 +13577,10 @@ QualType Sema::deduceVarTypeFromInitializer(VarDecl *VDecl,
                                                        InitsCopy);
   }
 
+  SmallVector<Expr *, 8> ExpandedInits;
   if (DirectInit) {
     if (auto *IL = dyn_cast<InitListExpr>(Init))
-      DeduceInits = IL->inits();
+      DeduceInits = getInitsWithEmbedExpanded(IL, ExpandedInits);
----------------
efriedma-quic wrote:

I don't think we actually need to expand here? We print an error if DeduceInits doesn't contain exactly one element.

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


More information about the cfe-commits mailing list