[clang] [LifetimeSafety] Track origins through std::function (PR #191123)

Zhijie Wang via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 08:03:18 PDT 2026


================
@@ -373,27 +382,20 @@ void FactsGenerator::handleAssignment(const Expr *LHSExpr,
 
   if (const auto *DRE_LHS = dyn_cast<DeclRefExpr>(LHSExpr))
     markUseAsWrite(DRE_LHS);
+  // RHS may not have tracked origins (e.g., assigning a non-lambda functor
+  // to a std::function). Skip the flow in that case.
+  if (!RHSList)
+    return;
----------------
aeft wrote:

Yes. Please see my comment for this pr. I have discussed this.

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


More information about the cfe-commits mailing list