xref: /llvm-project/clang/test/SemaObjC/warn-incompatible-builtin-types.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3@interface Foo
4- (void)foo:(Class)class; // expected-note{{passing argument to parameter 'class' here}}
5@end
6
7void FUNC(void) {
8    Class c, c1;
9    SEL s1, s2;
10    id i, i1;
11    Foo *f;
12    [f foo:f];	// expected-warning {{incompatible pointer types sending 'Foo *' to parameter of type 'Class'}}
13    c = f;	// expected-warning {{incompatible pointer types assigning to 'Class' from 'Foo *'}}
14
15    c = i;
16
17    i = c;
18
19    c = c1;
20
21    i = i1;
22
23    s1 = i;	// expected-warning {{incompatible pointer types assigning to 'SEL' from 'id'}}
24    i = s1;	// expected-warning {{incompatible pointer types assigning to 'id' from 'SEL'}}
25
26    s1 = s2;
27
28    s1 = c;	// expected-warning {{incompatible pointer types assigning to 'SEL' from 'Class'}}
29
30    c = s1;	// expected-warning {{incompatible pointer types assigning to 'Class' from 'SEL'}}
31
32    f = i;
33
34    f = c;	// expected-warning {{incompatible pointer types assigning to 'Foo *' from 'Class'}}
35
36    f = s1;	// expected-warning {{incompatible pointer types assigning to 'Foo *' from 'SEL'}}
37
38    i = f;
39
40    s1 = f; 	// expected-warning {{incompatible pointer types assigning to 'SEL' from 'Foo *'}}
41}
42