In debugger support mode, if we have a top-level message send
expression with an unknown result type, assume that the result type is
'id'. Fixes <rdar://problem/10400663>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146622 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/unknown-anytype.m b/test/SemaObjC/unknown-anytype.m
index 48eb91a..89e45e4 100644
--- a/test/SemaObjC/unknown-anytype.m
+++ b/test/SemaObjC/unknown-anytype.m
@@ -17,8 +17,13 @@
int *ip = [test0 getIntPtr];
float *fp = [test1() getFloatPtr];
double *dp = [test1() getSomePtr]; // okay: picks first method found
- [[test0 unknownMethod] otherUnknownMethod]; // expected-error{{no known method '-otherUnknownMethod'; cast the message send to the method's return type}}
+ [[test0 unknownMethod] otherUnknownMethod];
(void)(int)[[test0 unknownMethod] otherUnknownMethod];;
- [[test1() unknownMethod] otherUnknownMethod]; // expected-error{{no known method '-otherUnknownMethod'; cast the message send to the method's return type}}
+ [[test1() unknownMethod] otherUnknownMethod];
(void)(id)[[test1() unknownMethod] otherUnknownMethod];
+
+ if ([[test0 unknownMethod] otherUnknownMethod]) { // expected-error{{no known method '-otherUnknownMethod'; cast the message send to the method's return type}}
+ }
+ if ([[test1() unknownMethod] otherUnknownMethod]) { // expected-error{{no known method '-otherUnknownMethod'; cast the message send to the method's return type}}
+ }
}