[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 25 03:40:07 PDT 2025


================
@@ -4622,7 +4618,12 @@ handleLValueToRValueConversion(EvalInfo &Info, const Expr *Conv, QualType Type,
         }
       }
 
-      CompleteObject LitObj(LVal.Base, &Lit, Base->getType());
+      APValue *Lit =
+          CLE->hasStaticStorage()
+              ? &CLE->getStaticValue()
+              : Info.CurrentCall->getTemporary(Base, LVal.Base.getVersion());
+
+      CompleteObject LitObj(LVal.Base, Lit, Base->getType());
----------------
kadircet wrote:

thanks, moved CLE-specific logic there.

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


More information about the cfe-commits mailing list