summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/dynamic-cast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/dynamic-cast.cpp')
-rw-r--r--clang/test/Analysis/dynamic-cast.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Analysis/dynamic-cast.cpp b/clang/test/Analysis/dynamic-cast.cpp
index 62481e36357..8e63b2bcb36 100644
--- a/clang/test/Analysis/dynamic-cast.cpp
+++ b/clang/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;
+}
+
OpenPOWER on IntegriCloud