Fix the clang-wpa example.
[clang.git] / test / SemaObjC / property-inherited.m
blob5c5631e6fb89cf5da2f4c812cfadaeff0f430f23
1 // RUN: %clang_cc1 %s -fsyntax-only -verify 
3 // <rdar://problem/6497242> Inherited overridden protocol declared objects don't work
5 @protocol NSObject @end
6 @interface NSObject @end
8 @protocol FooDelegate<NSObject>
9 @optional
10 - (void)fooTask;
11 @end
13 @protocol BarDelegate<NSObject, FooDelegate>
14 @optional
15 - (void)barTask;
16 @end
18 @interface Foo : NSObject {
19   id _delegate;
21 @property(nonatomic, assign) id<FooDelegate> delegate;
22 @property(nonatomic, assign) id<BarDelegate> delegate2;
23 @end
24 @interface Bar : Foo {
26 @property(nonatomic, assign) id<BarDelegate> delegate;
27 @property(nonatomic, assign) id<FooDelegate> delegate2; // expected-warning{{property type 'id<FooDelegate>' is incompatible with type 'id<BarDelegate>' inherited from 'Foo'}}
28 @end
30 @interface NSData @end
32 @interface NSMutableData : NSData @end
34 @interface Base : NSData 
35 @property(assign) id ref;
36 @property(assign) Base *p_base;
37 @property(assign) NSMutableData *p_data;        
38 @end
40 @interface Data : Base 
41 @property(assign) NSData *ref;  
42 @property(assign) Data *p_base; 
43 @property(assign) NSData *p_data;       // expected-warning{{property type 'NSData *' is incompatible with type 'NSMutableData *' inherited from 'Base'}}
44 @end