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