summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/misc-ps-region-store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/misc-ps-region-store.cpp')
-rw-r--r--clang/test/Analysis/misc-ps-region-store.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/Analysis/misc-ps-region-store.cpp b/clang/test/Analysis/misc-ps-region-store.cpp
index fcffe075360..e30cedb9118 100644
--- a/clang/test/Analysis/misc-ps-region-store.cpp
+++ b/clang/test/Analysis/misc-ps-region-store.cpp
@@ -272,11 +272,11 @@ const Rdar9212495_A& rdar9212495(const Rdar9212495_C* ptr) {
const Rdar9212495_A& val = dynamic_cast<const Rdar9212495_A&>(*ptr);
// This is not valid C++; dynamic_cast with a reference type will throw an
- // exception if the pointer does not match the expected type.
+ // exception if the pointer does not match the expected type. However, our
+ // implementation of dynamic_cast will pass through a null pointer...or a
+ // "null reference"! So this branch is actually possible.
if (&val == 0) {
- val.bar(); // no warning (unreachable)
- int *p = 0;
- *p = 0xDEAD; // no warning (unreachable)
+ val.bar(); // expected-warning{{Called C++ object pointer is null}}
}
return val;
OpenPOWER on IntegriCloud