1 // RUN: %clang_cc1 -fsyntax-only -verify %s
9 [x method]; // expected-error{{receiver type 'x' is not an Objective-C class}}
14 typedef struct { int x; } ivar;
29 I2 *operator+(I2_holder, int);
35 // Test instance messages that start with a simple-type-specifier.
36 [I2_holder().get() method];
37 [I2_holder().get() + 17 method];
41 [ivar method]; // expected-error{{receiver type 'ivar' is not an Objective-C class}}
45 // Class message sends
60 + (int *)otherMethod {
61 // Test class messages that use non-trivial simple-type-specifiers
62 // or typename-specifiers.
65 return [typename identity<I3>::type method]; // expected-warning{{occurs outside of a template}}
70 int* ip1 = {[super method]};
71 int* ip2 = {[::I3 method]};
72 int* ip3 = {[typename identity<I3>::type method]}; // expected-warning{{occurs outside of a template}}
73 int* ip4 = {[typename identity<I2_holder>::type().get() method]}; // expected-warning{{occurs outside of a template}}
74 int array[5] = {[3] = 2};
75 return [super method];
83 struct MutableString : public String { };
85 // C++-specific parameter types
87 - method:(const String&)str1
88 other:(String&)str2; // expected-note{{passing argument to parameter 'str2' here}}
91 void test_I5(I5 *i5, String s) {
92 [i5 method:"hello" other:s];
93 [i5 method:s other:"world"]; // expected-error{{non-const lvalue reference to type 'String' cannot bind to a value of unrelated type 'const char [6]'}}
96 // <rdar://problem/8483253>
101 + (A *)create:(void (*)(void *x, X r, void *data))callback
102 callbackData:(void *)callback_data;
112 A *im = [A create:(void (*)(void *cgl_ctx, X r, void *data)) fun
116 // <rdar://problem/8807070>
117 template<typename T> struct X1; // expected-note{{template is declared here}}
125 [B blah]; // expected-error{{implicit instantiation of undefined template 'X1<int>'}}