[clang] [LifetimeSafety] Add origin tracking for lambda captures (PR #185216)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 10 05:09:57 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:

Thanks, this looks good to me with the new explanation! 

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


More information about the cfe-commits mailing list