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

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 04:50:20 PDT 2026


================
@@ -0,0 +1,95 @@
+#include "LifetimeModeling.h"
+#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
+#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
+#include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h"
+#include "clang/StaticAnalyzer/Core/Checker.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
+
+using namespace clang;
+using namespace ento;
+
+namespace {
+class ReportDanglingPtrDeref : public Checker<check::Location> {
----------------
isuckatcs wrote:

```suggestion
class DanglingPtrDerefChecker : public Checker<check::Location> {
```
?

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


More information about the cfe-commits mailing list