]> granicus.if.org Git - clang/commitdiff
[analyzer] Another dynamic_cast false positive/negative.
authorAnna Zaks <ganna@apple.com>
Wed, 11 Apr 2012 22:29:38 +0000 (22:29 +0000)
committerAnna Zaks <ganna@apple.com>
Wed, 11 Apr 2012 22:29:38 +0000 (22:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154543 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/dynamic-cast.cpp

index 62481e36357f0777e9586b2805a531d7be001711..8e63b2bcb363fcab376a894e6ac91395c2ac3a86 100644 (file)
@@ -221,3 +221,10 @@ int testDynCastFalsePositive(BB *c) {
   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;
+}
+