2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -verify %s
|
2009-04-14 23:11:46 +08:00
|
|
|
|
|
|
|
typedef struct objc_class *Class;
|
|
|
|
@interface XX
|
|
|
|
|
2010-04-22 08:20:18 +08:00
|
|
|
- (void)addObserver:(XX*)o; // expected-note 2{{passing argument to parameter 'o' here}}
|
2009-04-14 23:11:46 +08:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface YY
|
|
|
|
|
|
|
|
+ (void)classMethod;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation YY
|
|
|
|
|
|
|
|
static XX *obj;
|
|
|
|
|
|
|
|
+ (void)classMethod {
|
2010-04-09 08:35:39 +08:00
|
|
|
[obj addObserver:self]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}}
|
2009-04-14 23:11:46 +08:00
|
|
|
Class whatever;
|
2010-04-09 08:35:39 +08:00
|
|
|
[obj addObserver:whatever]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}}
|
2009-04-14 23:11:46 +08:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|