diff options
Diffstat (limited to 'clang/test/Analysis/dtor.cpp')
-rw-r--r-- | clang/test/Analysis/dtor.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Analysis/dtor.cpp b/clang/test/Analysis/dtor.cpp new file mode 100644 index 0000000..8d63cc4 --- /dev/null +++ b/clang/test/Analysis/dtor.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region -analyzer-ipa=inlining -cfg-add-implicit-dtors -verify %s + +class A { +public: + ~A() { + int *x = 0; + *x = 3; // expected-warning{{Dereference of null pointer}} + } +}; + +int main() { + A a; +} |