continue cleaning up code, and disable sending a message directly to an
interface. This fixes a bug where we used to accept:
void test2(NSNumber x) {
[x METH];
}
which doesn't make sense and GCC rejects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53841 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/objc-init.m b/test/Parser/objc-init.m
index 303d80c..4478665 100644
--- a/test/Parser/objc-init.m
+++ b/test/Parser/objc-init.m
@@ -11,13 +11,16 @@
}
void test2(NSNumber x) {
+ id objects[] = {[x METH]}; // expected-error {{bad receiver type}}
+}
+
+void test3(NSNumber *x) {
id objects[] = {[x METH]};
- return 0;
}
// rdar://5977581
-void test3() {
+void test4() {
unsigned x[] = {[NSNumber METH2]+2};
}