[clang] [clang][dataflow] Correctly treat empty initializer lists for unions. (PR #82986)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 26 09:16:40 PST 2024
================
@@ -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.
----------------
Xazax-hun wrote:
I am wondering how does CodeGen deal with this? If it happens to have similar extra logic, we could simplify both by changing the AST.
https://github.com/llvm/llvm-project/pull/82986
More information about the cfe-commits
mailing list