blob: ba70644ebae8ba61ef371515cef893dd62b65905 [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
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