[clang] [clang] Limit lifetimes of temporaries to the full expression (PR #170517)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 3 14:21:00 PST 2025


================
@@ -4947,7 +4948,23 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
     return;
   }
 
-  args.add(EmitAnyExprToTemp(E), type);
+   AggValueSlot ArgSlot = AggValueSlot::ignored();
+  // If the callee returns a reference, skip this stack saving optimization;
----------------
ilovepi wrote:

I guess that is true looking more closely. I've updated the comment per your suggestion.

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


More information about the cfe-commits mailing list