[clang] [analyzer] Implemented the DanglingPtrDeref checker to detect use-after-scope lifetime errors (PR #209278)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 04:54:02 PDT 2026


================
@@ -806,6 +806,11 @@ def UseAfterLifetimeEnd : Checker<"UseAfterLifetimeEnd">,
   Dependencies<[LifetimeModeling]>,
   Documentation<NotDocumented>;
 
+def ReportDanglingPtrDeref : Checker<"ReportDanglingPtrDeref">,
+  HelpText<"Check for dereferences of a dangling pointer">,
+  Dependencies<[LifetimeModeling]>,
+  Documentation<NotDocumented>;
----------------
NagyDonat wrote:

@steakhal I was not familiar with this policy and I would propose changing it.

Compared to actually implementing the checker, it takes negligible effort to describe the core goals of the checker in 1-2 sentences + copy 1-2 examples from the test files to the RST. I don't say that alpha checkers need _complete_ documentation that lists every quirk and limitation (and could easily become obsolete) but I think it is reasonable to require that they should appear in the list of checkers.

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


More information about the cfe-commits mailing list