[clang] [LifetimeSafety] Detect dangling fields (PR #177363)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 26 07:44:36 PST 2026


================
@@ -1235,6 +1235,11 @@ class CFG {
     bool AddEHEdges = false;
     bool AddInitializers = false;
     bool AddImplicitDtors = false;
+    // Add dtors for function parameters. In principle, function parameters are
+    // constructed and destructed in the caller context but analyses could still
+    // choose to include these in the callee's CFG to represent the dtors run on
+    // function exit.
+    bool AddParameterDtors = false;
----------------
Xazax-hun wrote:

If we do not need dtors, I'd prefer us not adding parameter dtors but fixing lifetime markers for functions without return statements. 

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


More information about the cfe-commits mailing list