blob: 6f7d1fd93f4fc106d2c5a0986311a287214e750f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// RUN: %clang_cc1 -verify %s
typedef struct objc_class *Class;
@interface XX
- (void)addObserver:(XX*)o;
@end
@interface YY
+ (void)classMethod;
@end
@implementation YY
static XX *obj;
+ (void)classMethod {
[obj addObserver:self]; // expected-warning {{incompatible pointer types sending 'Class', expected 'XX *'}}
Class whatever;
[obj addObserver:whatever]; // expected-warning {{incompatible pointer types sending 'Class', expected 'XX *'}}
}
@end
|