Debian Codegraph @

clang/test/SemaObjC/warn-incompatible-builtin-types.m

raw
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
7 void FUNC(void) {
8 Class c, c1;
9 SEL s1, s2;
10 id i, i1;
11 Foo *f;
12 [f foo:f]; // expected-error {{incompatible pointer types sending 'Foo *' to parameter of type 'Class'}}
13 c = f; // expected-error {{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-error {{incompatible pointer types assigning to 'SEL' from 'id'}}
24 i = s1; // expected-error {{incompatible pointer types assigning to 'id' from 'SEL'}}
25
26 s1 = s2;
27
28 s1 = c; // expected-error {{incompatible pointer types assigning to 'SEL' from 'Class'}}
29
30 c = s1; // expected-error {{incompatible pointer types assigning to 'Class' from 'SEL'}}
31
32 f = i;
33
34 f = c; // expected-error {{incompatible pointer types assigning to 'Foo *' from 'Class'}}
35
36 f = s1; // expected-error {{incompatible pointer types assigning to 'Foo *' from 'SEL'}}
37
38 i = f;
39
40 s1 = f; // expected-error {{incompatible pointer types assigning to 'SEL' from 'Foo *'}}
41 }