summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/cast-value-notes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/cast-value-notes.cpp')
-rw-r--r--clang/test/Analysis/cast-value-notes.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/test/Analysis/cast-value-notes.cpp b/clang/test/Analysis/cast-value-notes.cpp
index 6e7f6b01af7..f92ba90336a 100644
--- a/clang/test/Analysis/cast-value-notes.cpp
+++ b/clang/test/Analysis/cast-value-notes.cpp
@@ -27,9 +27,9 @@ void evalReferences(const Shape &S) {
}
void evalNonNullParamNonNullReturnReference(const Shape &S) {
+ // Unmodeled cast from reference to pointer.
const auto *C = dyn_cast_or_null<Circle>(S);
- // expected-note@-1 {{Assuming 'S' is a 'Circle'}}
- // expected-note@-2 {{'C' initialized here}}
+ // expected-note@-1 {{'C' initialized here}}
if (!dyn_cast_or_null<Circle>(C)) {
// expected-note@-1 {{'C' is a 'Circle'}}
@@ -132,10 +132,11 @@ void evalZeroParamNonNullReturn(const Shape &S) {
// expected-warning@-3 {{Division by zero}}
}
-void evalZeroParamNullReturn(const Shape &S) {
- const auto *C = S.getAs<Circle>();
+void evalZeroParamNullReturn(const Shape *S) {
+ const auto &C = S->getAs<Circle>();
// expected-note@-1 {{Assuming 'S' is not a 'Circle'}}
- // expected-note@-2 {{'C' initialized to a null pointer value}}
+ // expected-note@-2 {{Storing null pointer value}}
+ // expected-note@-3 {{'C' initialized here}}
if (!dyn_cast_or_null<Triangle>(S)) {
// expected-note@-1 {{Assuming 'S' is a 'Triangle'}}
OpenPOWER on IntegriCloud