diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-02-26 19:44:38 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-02-26 19:44:38 +0000 |
commit | 4238f41d484729aca260140fbbc53a68769bf60a (patch) | |
tree | b985488d66c1d4f0305a3d2bde872977fb7e2b5e /test/Analysis/method-call-path-notes.cpp | |
parent | 9016bb771265a10f188c76342254badecc695253 (diff) |
[analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion.
Fixes PR15358 and <rdar://problem/13295437>.
Along the way, shorten path diagnostics that say "Variable 'x'" to just
be "'x'". By the context, it is obvious that we have a variable,
and so this just consumes text space.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/method-call-path-notes.cpp')
-rw-r--r-- | test/Analysis/method-call-path-notes.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/Analysis/method-call-path-notes.cpp b/test/Analysis/method-call-path-notes.cpp index d6308a7bfa..f946b327d0 100644 --- a/test/Analysis/method-call-path-notes.cpp +++ b/test/Analysis/method-call-path-notes.cpp @@ -10,12 +10,12 @@ public: }; void test_ic() { - TestInstanceCall *p; // expected-note {{Variable 'p' declared without an initial value}} + TestInstanceCall *p; // expected-note {{'p' declared without an initial value}} p->foo(); // expected-warning {{Called C++ object pointer is uninitialized}} expected-note {{Called C++ object pointer is uninitialized}} } void test_ic_null() { - TestInstanceCall *p = 0; // expected-note {{Variable 'p' initialized to a null pointer value}} + TestInstanceCall *p = 0; // expected-note {{'p' initialized to a null pointer value}} p->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note {{Called C++ object pointer is null}} } @@ -31,7 +31,7 @@ void test_ic_null(TestInstanceCall *p) { } void test_ic_member_ptr() { - TestInstanceCall *p = 0; // expected-note {{Variable 'p' initialized to a null pointer value}} + TestInstanceCall *p = 0; // expected-note {{'p' initialized to a null pointer value}} typedef void (TestInstanceCall::*IC_Ptr)(); IC_Ptr bar = &TestInstanceCall::foo; (p->*bar)(); // expected-warning {{Called C++ object pointer is null}} expected-note{{Called C++ object pointer is null}} @@ -72,9 +72,9 @@ void test_cast(const TestInstanceCall *p) { // CHECK-NEXT: </array> // CHECK-NEXT: <key>depth</key><integer>0</integer> // CHECK-NEXT: <key>extended_message</key> -// CHECK-NEXT: <string>Variable 'p' declared without an initial value</string> +// CHECK-NEXT: <string>'p' declared without an initial value</string> // CHECK-NEXT: <key>message</key> -// CHECK-NEXT: <string>Variable 'p' declared without an initial value</string> +// CHECK-NEXT: <string>'p' declared without an initial value</string> // CHECK-NEXT: </dict> // CHECK-NEXT: <dict> // CHECK-NEXT: <key>kind</key><string>control</string> @@ -181,9 +181,9 @@ void test_cast(const TestInstanceCall *p) { // CHECK-NEXT: </array> // CHECK-NEXT: <key>depth</key><integer>0</integer> // CHECK-NEXT: <key>extended_message</key> -// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string> +// CHECK-NEXT: <string>'p' initialized to a null pointer value</string> // CHECK-NEXT: <key>message</key> -// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string> +// CHECK-NEXT: <string>'p' initialized to a null pointer value</string> // CHECK-NEXT: </dict> // CHECK-NEXT: <dict> // CHECK-NEXT: <key>kind</key><string>control</string> @@ -576,9 +576,9 @@ void test_cast(const TestInstanceCall *p) { // CHECK-NEXT: </array> // CHECK-NEXT: <key>depth</key><integer>0</integer> // CHECK-NEXT: <key>extended_message</key> -// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string> +// CHECK-NEXT: <string>'p' initialized to a null pointer value</string> // CHECK-NEXT: <key>message</key> -// CHECK-NEXT: <string>Variable 'p' initialized to a null pointer value</string> +// CHECK-NEXT: <string>'p' initialized to a null pointer value</string> // CHECK-NEXT: </dict> // CHECK-NEXT: <dict> // CHECK-NEXT: <key>kind</key><string>control</string> |