================
@@ -208,6 +208,8 @@ bool isASafeCallArg(const Expr *E) {
         return true;
     }
   }
+  if (isa<CXXTemporaryObjectExpr>(E))
+    return true; // A temporary lives until the end of this statement.
----------------
haoNoQ wrote:

Oooooooooh. Right. You already know it's an argument. Yeah, case closed, the 
codegen-style recursive approach wins again.

And it looks like you've correctly skipped the `MaterializeTemporaryExpr` which 
is probably there in your test because the argument is accepted by reference. 
There may also be a `CXXBindTemporaryExpr` if the class has a destructor but 
it's probably peeled correctly for the same reason.

You folks are really good at this :sweat_smile:

https://github.com/llvm/llvm-project/pull/155033
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to