[clang] [LifetimeSafety] Add support for `new`/`delete` (PR #192504)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 19 10:48:37 PDT 2026


================
@@ -195,33 +221,33 @@ class LifetimeChecker {
     /// Get loans directly pointing to the invalidated container
     LoanSet DirectlyInvalidatedLoans =
         LoanPropagation.getLoans(InvalidatedOrigin, IOF);
-    auto IsInvalidated = [&](const Loan *L) {
+    auto IsInvalidated = [&](const LoanID &LID) {
       for (LoanID InvalidID : DirectlyInvalidatedLoans) {
         const Loan *InvalidL = FactMgr.getLoanMgr().getLoan(InvalidID);
+        const Loan *L = FactMgr.getLoanMgr().getLoan(LID);
----------------
usx95 wrote:

Please move this outside the `for` loop. 

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


More information about the cfe-commits mailing list