Fariborz Jahanian | 1147c5e | 2009-12-14 17:36:25 +0000 | [diff] [blame] | 1 | // RUN: clang -cc1 %s -fsyntax-only |
Steve Naroff | 075878a | 2007-10-12 16:15:17 +0000 | [diff] [blame] | 2 | |
Steve Naroff | 075878a | 2007-10-12 16:15:17 +0000 | [diff] [blame] | 3 | @interface NSObject |
4 | + alloc; | ||||
5 | - init; | ||||
6 | @end | ||||
Steve Naroff | b216c88 | 2007-10-09 22:01:59 +0000 | [diff] [blame] | 7 | |
8 | struct D { | ||||
9 | double d; | ||||
10 | }; | ||||
11 | |||||
12 | @interface Foo : NSObject | ||||
13 | |||||
14 | - method:(int)a; | ||||
15 | - method:(int)a; | ||||
16 | |||||
17 | @end | ||||
18 | |||||
19 | @interface Bar : NSObject | ||||
20 | |||||
21 | - method:(void *)a; | ||||
22 | |||||
23 | @end | ||||
24 | |||||
25 | @interface Car : NSObject | ||||
26 | |||||
27 | - method:(struct D)a; | ||||
28 | |||||
29 | @end | ||||
30 | |||||
31 | @interface Zar : NSObject | ||||
32 | |||||
33 | - method:(float)a; | ||||
34 | |||||
35 | @end | ||||
36 | |||||
37 | @interface Rar : NSObject | ||||
38 | |||||
39 | - method:(float)a; | ||||
40 | |||||
41 | @end | ||||
42 | |||||
43 | int main() { | ||||
Steve Naroff | 075878a | 2007-10-12 16:15:17 +0000 | [diff] [blame] | 44 | id xx = [[Car alloc] init]; // expected-warning {{incompatible types assigning 'int' to 'id'}} |
Steve Naroff | b216c88 | 2007-10-09 22:01:59 +0000 | [diff] [blame] | 45 | |
Steve Naroff | 3b95017 | 2007-10-10 21:53:07 +0000 | [diff] [blame] | 46 | [xx method:4]; |
Steve Naroff | b216c88 | 2007-10-09 22:01:59 +0000 | [diff] [blame] | 47 | } |