================
@@ -3720,9 +3723,9 @@ bool Compiler<Emitter>::VisitCompoundLiteralExpr(const
CompoundLiteralExpr *E) {
if (!this->emitGetPtrGlobal(*GlobalIndex, E))
return false;
- // Since this is a global variable, we might've already seen,
- // don't do it again.
- if (P.isGlobalInitialized(*GlobalIndex))
+ // An ordinary C23 literal may have been folded for static initialization.
+ if (P.isGlobalInitialized(*GlobalIndex) &&
+ (!Ctx.getLangOpts().C23 || E->isConstexpr()))
----------------
tbaederr wrote:
I thought this is too specific, I opened
https://github.com/llvm/llvm-project/pull/237133 which makes this block
unnecessary.
https://github.com/llvm/llvm-project/pull/212559
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits