blob: e84d21432c6f0f2a26eb018659e0ba41d45ac06b [file] [log] [blame]
Chris Lattner4045a8a2007-10-11 00:18:28 +00001// RUN: clang %s -fsyntax-only
Steve Naroff9e1db882007-10-12 16:15:17 +00002
3typedef struct objc_object *id;
4@interface NSObject
5+ alloc;
6- init;
7@end
Steve Naroff9637a9b2007-10-09 22:01:59 +00008
9struct 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
44int main() {
Steve Naroff9e1db882007-10-12 16:15:17 +000045 id xx = [[Car alloc] init]; // expected-warning {{incompatible types assigning 'int' to 'id'}}
Steve Naroff9637a9b2007-10-09 22:01:59 +000046
Steve Naroffee1de132007-10-10 21:53:07 +000047 [xx method:4];
Steve Naroff9637a9b2007-10-09 22:01:59 +000048}