summaryrefslogtreecommitdiffstats
path: root/test/Analysis
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-04-11 22:29:38 +0000
committerAnna Zaks <ganna@apple.com>2012-04-11 22:29:38 +0000
commitc3fa98f67038bec98651f833b685c104ef6438ab (patch)
treec2d9ba7af45a152d43c6a5df7f8dc1233545f58e /test/Analysis
parent7ea1c5639764aa3ebe124f4350c5f2b3be795667 (diff)
[analyzer] Another dynamic_cast false positive/negative.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/dynamic-cast.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Analysis/dynamic-cast.cpp b/test/Analysis/dynamic-cast.cpp
index 62481e3635..8e63b2bcb3 100644
--- a/test/Analysis/dynamic-cast.cpp
+++ b/test/Analysis/dynamic-cast.cpp
@@ -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;
+}
+