blob: 6f7d1fd93f4fc106d2c5a0986311a287214e750f [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -verify %s
Steve Naroffd824c9c2009-04-14 15:11:46 +00002
3typedef struct objc_class *Class;
4@interface XX
5
6- (void)addObserver:(XX*)o;
7
8@end
9
10@interface YY
11
12+ (void)classMethod;
13
14@end
15
16@implementation YY
17
18static XX *obj;
19
20+ (void)classMethod {
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000021 [obj addObserver:self]; // expected-warning {{incompatible pointer types sending 'Class', expected 'XX *'}}
Steve Naroffd824c9c2009-04-14 15:11:46 +000022 Class whatever;
Fariborz Jahaniand4c60902010-03-19 18:06:10 +000023 [obj addObserver:whatever]; // expected-warning {{incompatible pointer types sending 'Class', expected 'XX *'}}
Steve Naroffd824c9c2009-04-14 15:11:46 +000024}
25@end
26