blob: fd4fb7d3a11d92dad55cf63b742e43c752c066c5 [file] [log] [blame]
Fariborz Jahaniand4c60902010-03-19 18:06:10 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanian24fce282010-11-09 02:16:57 +00002// rdar://7634850
Fariborz Jahaniand4c60902010-03-19 18:06:10 +00003
4@interface Foo
Douglas Gregora41a8c52010-04-22 00:20:18 +00005- (void)foo:(Class)class; // expected-note{{passing argument to parameter 'class' here}}
Fariborz Jahaniand4c60902010-03-19 18:06:10 +00006@end
7
8void FUNC() {
9 Class c, c1;
10 SEL s1, s2;
11 id i, i1;
12 Foo *f;
Douglas Gregord4eea832010-04-09 00:35:39 +000013 [f foo:f]; // expected-warning {{incompatible pointer types sending 'Foo *' to parameter of type 'Class'}}
14 c = f; // expected-warning {{incompatible pointer types assigning to 'Class' from 'Foo *'}}
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000015
16 c = i;
17
18 i = c;
19
20 c = c1;
21
22 i = i1;
23
Douglas Gregord4eea832010-04-09 00:35:39 +000024 s1 = i; // expected-warning {{incompatible pointer types assigning to 'SEL' from 'id'}}
25 i = s1; // expected-warning {{incompatible pointer types assigning to 'id' from 'SEL'}}
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000026
27 s1 = s2;
28
Douglas Gregord4eea832010-04-09 00:35:39 +000029 s1 = c; // expected-warning {{incompatible pointer types assigning to 'SEL' from 'Class'}}
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000030
Douglas Gregord4eea832010-04-09 00:35:39 +000031 c = s1; // expected-warning {{incompatible pointer types assigning to 'Class' from 'SEL'}}
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000032
33 f = i;
34
Douglas Gregord4eea832010-04-09 00:35:39 +000035 f = c; // expected-warning {{incompatible pointer types assigning to 'Foo *' from 'Class'}}
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000036
Douglas Gregord4eea832010-04-09 00:35:39 +000037 f = s1; // expected-warning {{incompatible pointer types assigning to 'Foo *' from 'SEL'}}
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000038
39 i = f;
40
Douglas Gregord4eea832010-04-09 00:35:39 +000041 s1 = f; // expected-warning {{incompatible pointer types assigning to 'SEL' from 'Foo *'}}
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000042}