[clang] [WebKit Checkers] Treat a temporary which gets passed as a r-value reference as trivial (PR #198919)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Thu May 21 03:45:02 PDT 2026


================
@@ -888,17 +888,59 @@ class TrivialFunctionAnalysisVisitor
   }
 
   bool checkArguments(const CallExpr *CE) {
+    auto *Callee = CE->getDirectCallee();
+    unsigned ArgOffset =
+        isa<CXXOperatorCallExpr>(CE) && isa_and_nonnull<CXXMethodDecl>(Callee);
+    unsigned ArgIndex = 0;
----------------
steakhal wrote:

Have you considered using `llvm::enumerate` and deriving this from the `llvm::enumerate(CE->arguments())`?

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


More information about the cfe-commits mailing list