[clang] [alpha.webkit.UncheckedCallArgsChecker] Don't emit a warning for passing a temporary object as an argument. (PR #155033)
Artem Dergachev via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 8 18:51:38 PDT 2025
================
@@ -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
More information about the cfe-commits
mailing list