[clang] [webkit.UncountedLambdaCapturesChecker] Ignore a lambda which gets called immediately (PR #162977)
Ryosuke Niwa via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 9 12:47:23 PST 2025
================
@@ -343,6 +343,16 @@ class RawPtrRefLambdaCapturesChecker
auto *Callee = CE->getCallee();
if (!Callee)
return;
+ Callee = Callee->IgnoreParenCasts();
+ if (auto *MTE = dyn_cast<MaterializeTemporaryExpr>(Callee))
+ Callee = MTE->getSubExpr();
+ if (!Callee)
+ return;
+ Callee = Callee->IgnoreParenCasts();
----------------
rniwa wrote:
I think this is needed in the case we do: `Callee = MTE->getSubExpr();` in line 348. I'll move this and null check for `Callee` inside the if statement for clarity.
https://github.com/llvm/llvm-project/pull/162977
More information about the cfe-commits
mailing list