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