[clang] [LifetimeSafety] Add origin tracking for lambda captures (PR #185216)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 9 02:58:25 PDT 2026
================
@@ -181,6 +181,14 @@ void FactsGenerator::VisitCXXConstructExpr(const CXXConstructExpr *CCE) {
handleGSLPointerConstruction(CCE);
return;
}
+ if (const auto *RD = CCE->getType()->getAsCXXRecordDecl();
+ RD && RD->isLambda() && CCE->getNumArgs() == 1) {
+ const Expr *Arg = CCE->getArg(0);
----------------
Xazax-hun wrote:
What case are we covering here? Is this when lambda's copy/move operations are called? I think it would be worth to call this out and maybe making the checking a bit more strict.
https://github.com/llvm/llvm-project/pull/185216
More information about the cfe-commits
mailing list