diff options
Diffstat (limited to 'test/Analysis/NewDeleteLeaks-PR18394.cpp')
| -rw-r--r-- | test/Analysis/NewDeleteLeaks-PR18394.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Analysis/NewDeleteLeaks-PR18394.cpp b/test/Analysis/NewDeleteLeaks-PR18394.cpp new file mode 100644 index 0000000000000..dfd94561628f8 --- /dev/null +++ b/test/Analysis/NewDeleteLeaks-PR18394.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -analyzer-config graph-trim-interval=1 -analyzer-max-loop 1 -analyze -analyzer-checker=core,alpha.cplusplus.NewDeleteLeaks -verify %s +// expected-no-diagnostics + +class A { +public: + void f() {}; + ~A() { + for (int i=0; i<3; i++) + f(); + } +}; + +void error() { + A *a = new A(); + delete a; +} |
