[clang] [LifetimeSafety] Detect expiry of loans to trivially destructed types (PR #168855)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 21 00:52:04 PST 2025


================
@@ -66,6 +66,9 @@ void FactsGenerator::run() {
       else if (std::optional<CFGAutomaticObjDtor> DtorOpt =
                    Element.getAs<CFGAutomaticObjDtor>())
         handleDestructor(*DtorOpt);
+      else if (std::optional<CFGLifetimeEnds> LifetimeEnds =
+                   Element.getAs<CFGLifetimeEnds>())
+        handleTrivialDestructors(*LifetimeEnds);
----------------
usx95 wrote:

Can you attach the CFG for some of these tests.  
This can be done via `-mllvm -debug-only=PrintCFG,LifetimeFacts`​ https://godbolt.org/z/vGGndnYcz

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


More information about the cfe-commits mailing list