summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-04-01 06:52:48 +0000
committerTed Kremenek <kremenek@apple.com>2009-04-01 06:52:48 +0000
commit8b0dba358a3fae6695aff56a150b9e18f66e0cf3 (patch)
tree39336620737513cc431993a0a611585d0ecf7b34 /clang/test
parent3088a31e96ab75f567e272dc5f6ca5fe347d6caa (diff)
downloadbcm5719-llvm-8b0dba358a3fae6695aff56a150b9e18f66e0cf3.tar.gz
bcm5719-llvm-8b0dba358a3fae6695aff56a150b9e18f66e0cf3.zip
Fix: <rdar://problem/6740387>. Sending nil to an object that returns a struct
should only be an error if that value is consumed. This fix was largely accomplished by moving 'isConsumedExpr' back to ParentMap. llvm-svn: 68195
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m b/clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
index d1f0802abf8..5d1fa37c46a 100644
--- a/clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
+++ b/clang/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m
@@ -17,3 +17,9 @@ void createFoo() {
Bar f = [obj foo]; // expected-warning{{The receiver in the message expression is 'nil' and results in the returned value (of type 'Bar') to be garbage or otherwise undefined.}}
}
+void createFoo2() {
+ MyClass *obj = 0;
+ [obj foo]; // no-warning
+ Bar f = [obj foo]; // expected-warning{{The receiver in the message expression is 'nil' and results in the returned value (of type 'Bar') to be garbage or otherwise undefined.}}
+}
+
OpenPOWER on IntegriCloud