================
@@ -685,9 +685,22 @@ class TransferVisitor : public 
ConstStmtVisitor<TransferVisitor> {
 
     // `S->inits()` contains all the initializer expressions, including the
     // ones for direct base classes.
-    auto Inits = S->inits();
+    ArrayRef<Expr *> Inits = S->inits();
     size_t InitIdx = 0;
 
+    // Unions initialized with an empty initializer list need special 
treatment.
----------------
martinboehme wrote:

It appears that CodeGen also appears to special-case this like we do:

https://github.com/llvm/llvm-project/blob/e08fe575d5953b6ca0d7a578c1afa00247f0a12f/clang/lib/CodeGen/CGExprAgg.cpp#L1760

And if we changed the AST so that we had an `ImplicitValueInitExpr` here, it 
looks as if the general case in CodeGen would do the right thing.

I'll make a note of this for myself.

https://github.com/llvm/llvm-project/pull/82986
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to