From 7c15040e9880e31514780efd6460e3e86ffca6ac Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 7 Sep 2012 06:51:37 +0000 Subject: Fix bug in ConditionBRVisitor where for C++ (and not C) we were not ignoring implicit pointer-to-boolean conversions in condition expressions. This would result in inconsistent diagnostic emission between C and C++. A consequence of this is now ConditionBRVisitor and TrackConstraintBRVisitor may emit redundant diagnostics, for example: "Assuming pointer value is null" (TrackConstraintBRVisitor) "Assuming 'p' is null" (ConditionBRVisitor) We need to reconcile the two, and perhaps prefer one over the other in some cases. llvm-svn: 163372 --- clang/test/Analysis/method-call-path-notes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/test/Analysis/method-call-path-notes.cpp') diff --git a/clang/test/Analysis/method-call-path-notes.cpp b/clang/test/Analysis/method-call-path-notes.cpp index 17034b9b000..b95ec98ec84 100644 --- a/clang/test/Analysis/method-call-path-notes.cpp +++ b/clang/test/Analysis/method-call-path-notes.cpp @@ -25,7 +25,7 @@ void test_ic_set_to_null() { } void test_ic_null(TestInstanceCall *p) { - if (!p) // expected-note {{Assuming pointer value is null}} expected-note {{Taking true branch}} + if (!p) // expected-note {{Assuming pointer value is null}} expected-note {{Assuming 'p' is null}} expected-note {{Taking true branch}} p->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note{{Called C++ object pointer is null}} } @@ -37,7 +37,7 @@ void test_ic_member_ptr() { } void test_cast(const TestInstanceCall *p) { - if (!p) // expected-note {{Assuming pointer value is null}} expected-note {{Taking true branch}} + if (!p) // expected-note {{Assuming pointer value is null}} expected-note {{Assuming 'p' is null}} expected-note {{Taking true branch}} const_cast(p)->foo(); // expected-warning {{Called C++ object pointer is null}} expected-note {{Called C++ object pointer is null}} } -- cgit v1.2.3