summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/diagnostics
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-09-07 06:51:37 +0000
committerTed Kremenek <kremenek@apple.com>2012-09-07 06:51:37 +0000
commit7c15040e9880e31514780efd6460e3e86ffca6ac (patch)
tree5a4281f2aff5a1e477eb853c79676f68a53ef648 /clang/test/Analysis/diagnostics
parent1cb637cc37c60a4f18a33f80f56489a5a7602330 (diff)
downloadbcm5719-llvm-7c15040e9880e31514780efd6460e3e86ffca6ac.tar.gz
bcm5719-llvm-7c15040e9880e31514780efd6460e3e86ffca6ac.zip
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
Diffstat (limited to 'clang/test/Analysis/diagnostics')
-rw-r--r--clang/test/Analysis/diagnostics/deref-track-symbolic-region.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/test/Analysis/diagnostics/deref-track-symbolic-region.cpp b/clang/test/Analysis/diagnostics/deref-track-symbolic-region.cpp
index 87313de13a8..4a5f0cfa3f7 100644
--- a/clang/test/Analysis/diagnostics/deref-track-symbolic-region.cpp
+++ b/clang/test/Analysis/diagnostics/deref-track-symbolic-region.cpp
@@ -11,6 +11,7 @@ void test(S *p) {
if (p) return;
//expected-note@-1{{Taking false branch}}
//expected-note@-2{{Assuming pointer value is null}}
+ //expected-note@-3{{Assuming 'p' is null}}
r.y = 5; // expected-warning {{Access to field 'y' results in a dereference of a null pointer (loaded from variable 'r')}}
// expected-note@-1{{Access to field 'y' results in a dereference of a null pointer (loaded from variable 'r')}}
}
OpenPOWER on IntegriCloud