diff options
| author | Jordan Rose <jordan_rose@apple.com> | 2013-07-23 02:15:20 +0000 |
|---|---|---|
| committer | Jordan Rose <jordan_rose@apple.com> | 2013-07-23 02:15:20 +0000 |
| commit | 316cdda54bd6e25a02a4f01012fa8e7d0da2fe3d (patch) | |
| tree | 4eb869eac808b30ebb8663d5752ec8bec19424fc /clang/test | |
| parent | a45ffe17c717047a0286c44ef5074fe6f37f7caa (diff) | |
| download | bcm5719-llvm-316cdda54bd6e25a02a4f01012fa8e7d0da2fe3d.tar.gz bcm5719-llvm-316cdda54bd6e25a02a4f01012fa8e7d0da2fe3d.zip | |
[analyzer] Enable pseudo-destructor expressions.
These are cases where a scalar type is "destructed", usually due to
template instantiation (e.g. "obj.~T()", where 'T' is 'int'). This has
no actual effect and the analyzer should just skip over it.
llvm-svn: 186927
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Analysis/dtor.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Analysis/dtor.cpp b/clang/test/Analysis/dtor.cpp index 58bdcea6317..436da2ed9f3 100644 --- a/clang/test/Analysis/dtor.cpp +++ b/clang/test/Analysis/dtor.cpp @@ -417,3 +417,17 @@ namespace NoReturn { *x = 47; // no warning } } + +namespace PseudoDtor { + template <typename T> + void destroy(T &obj) { + clang_analyzer_checkInlined(true); // expected-warning{{TRUE}} + obj.~T(); + } + + void test() { + int i; + destroy(i); + clang_analyzer_eval(true); // expected-warning{{TRUE}} + } +} |

