commit | 918d52cc53f2a01f11f52bc2d8556469c640694e | [log] [tgz] |
---|---|---|
author | Anna Zaks <ganna@apple.com> | Wed Apr 11 22:29:38 2012 +0000 |
committer | Anna Zaks <ganna@apple.com> | Wed Apr 11 22:29:38 2012 +0000 |
tree | 6adfa744432fe80bcd5cc76c1e6c2d4e9e99efb5 | |
parent | f36a6f54aef44bc8fceb84ea0ca01ffc08945365 [diff] [blame] |
[analyzer] Another dynamic_cast false positive/negative. llvm-svn: 154543
diff --git a/clang/test/Analysis/dynamic-cast.cpp b/clang/test/Analysis/dynamic-cast.cpp index 62481e3..8e63b2b 100644 --- a/clang/test/Analysis/dynamic-cast.cpp +++ b/clang/test/Analysis/dynamic-cast.cpp
@@ -221,3 +221,10 @@ return *res; // expected-warning{{Dereference of null pointer}} } +// Does not work when we new an object. +int testDynCastFail3() { + A *a = new A(); + B *b = dynamic_cast<B*>(a); + return b->m; +} +