blob: b1e37bfe58f2785426f968f5021b9107b873acc8 [file] [log] [blame]
Patrick Beardacfbe9e2012-04-06 18:12:22 +00001// RUN: %clang_cc1 -verify -Wno-objc-root-class %s
Steve Naroff06f440d2009-04-14 15:11:46 +00002
3typedef struct objc_class *Class;
4@interface XX
5
Douglas Gregor4f4946a2010-04-22 00:20:18 +00006- (void)addObserver:(XX*)o; // expected-note 2{{passing argument to parameter 'o' here}}
Steve Naroff06f440d2009-04-14 15:11:46 +00007
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 {
Douglas Gregorc68e1402010-04-09 00:35:39 +000021 [obj addObserver:self]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}}
Steve Naroff06f440d2009-04-14 15:11:46 +000022 Class whatever;
Douglas Gregorc68e1402010-04-09 00:35:39 +000023 [obj addObserver:whatever]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}}
Steve Naroff06f440d2009-04-14 15:11:46 +000024}
25@end
26