[clang] [clang][CodeGen] Emit lifetime markers for block-scoped compound literals in C (PR #219045)

Nick Desaulniers via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 16:53:28 PDT 2026


================
@@ -6005,6 +6005,13 @@ LValue CodeGenFunction::EmitCompoundLiteralLValue(const CompoundLiteralExpr *E){
   const Expr *InitExpr = E->getInitializer();
   LValue Result = MakeAddrLValue(DeclPtr, E->getType(), AlignmentSource::Decl);
 
+  if (!getLangOpts().CPlusPlus) {
+    if (HaveInsertPoint() && !hasLabelBeenSeenInCurrentScope() &&
----------------
nickdesaulniers wrote:

https://gist.github.com/nickdesaulniers/9549931cda8c969c35c866b8241708c7

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


More information about the cfe-commits mailing list