commit | c3fa98f67038bec98651f833b685c104ef6438ab | [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 | c2d9ba7af45a152d43c6a5df7f8dc1233545f58e | |
parent | 7ea1c5639764aa3ebe124f4350c5f2b3be795667 [diff] [blame] |
[analyzer] Another dynamic_cast false positive/negative. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154543 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/dynamic-cast.cpp b/test/Analysis/dynamic-cast.cpp index 62481e3..8e63b2b 100644 --- a/test/Analysis/dynamic-cast.cpp +++ b/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; +} +