[clang] [analyzer] Implemented the DanglingPtrDeref checker to detect use-after-scope lifetime errors (PR #206460)
Benedek Kaibas via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 12 13:56:34 PDT 2026
================
@@ -0,0 +1,53 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.cplusplus.ReportDanglingPtrDeref \
+// RUN: -analyzer-config cfg-lifetime=true -analyzer-output=text -verify %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.cplusplus.ReportDanglingPtrDeref \
+// RUN: -analyzer-config c++-container-inlining=false -analyzer-config cfg-lifetime=true -analyzer-output=text -verify %s
----------------
benedekaibas wrote:
I have checked and there is no reason for me to use `c++-container-inlining=false` for this test suite, so I have removed it and AFAIK because of that change I would not need to do a `// DEFINE` directive anymore to hoist the common lines out of the RUN lines. However, thank you for bringing this up I haven't thought about it, I will make sure to use it for future test suites when it will be needed.
https://github.com/llvm/llvm-project/pull/206460
More information about the cfe-commits
mailing list