[clang] [LifetimeSafety] Suggest lifetime annotations (PR #169767)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 2 20:38:51 PST 2025


================
@@ -114,9 +114,11 @@ class LifetimeTestHelper {
       return {};
     }
     std::vector<LoanID> LID;
-    for (const Loan &L : Analysis.getFactManager().getLoanMgr().getLoans())
-      if (L.Path.D == VD)
-        LID.push_back(L.ID);
+    for (const Loan *L : Analysis.getFactManager().getLoanMgr().getLoans())
+      if (const auto *BL = dyn_cast<BorrowLoan>(L)) {
+        if (BL->getAccessPath().D == VD)
+          LID.push_back(L->getID());
+      }
----------------
usx95 wrote:

nit: drop the braces

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


More information about the cfe-commits mailing list