1 // RUN: %clang_cc1 %s -fsyntax-only -verify
2 // RUN: %clang_cc1 -x objective-c++ %s -fsyntax-only -verify
4 // Inherited overridden protocol declared objects don't work
7 @protocol NSObject @end
8 @interface NSObject @end
10 @protocol FooDelegate<NSObject>
15 @protocol BarDelegate<NSObject, FooDelegate>
20 @interface Foo : NSObject {
23 @property(nonatomic, assign) id<FooDelegate> delegate;
24 @property(nonatomic, assign) id<BarDelegate> delegate2; // expected-note {{property declared here}}
26 @interface Bar : Foo {
28 @property(nonatomic, assign) id<BarDelegate> delegate;
29 @property(nonatomic, assign) id<FooDelegate> delegate2; // expected-warning{{property type 'id<FooDelegate>' is incompatible with type 'id<BarDelegate>' inherited from 'Foo'}}
32 @interface NSData @end
34 @interface NSMutableData : NSData @end
36 @interface Base : NSData
37 @property(assign) id ref;
38 @property(assign) Base *p_base;
39 @property(assign) NSMutableData *p_data; // expected-note {{property declared here}}
42 @interface Data : Base
43 @property(assign) NSData *ref;
44 @property(assign) Data *p_base;
45 @property(assign) NSData *p_data; // expected-warning{{property type 'NSData *' is incompatible with type 'NSMutableData *' inherited from 'Base'}}
49 @property (nonatomic) void* selected;
53 @property (nonatomic) void* selected; // expected-note {{property declared here}}
56 @interface MKAnnotationView <P1>
57 @property (nonatomic) void* selected; // expected-note {{property declared here}}
58 @property (nonatomic) char selected2;
61 @interface Parent : MKAnnotationView <P2>
62 @property (nonatomic) void* selected1; // expected-note {{property declared here}}
63 @property (nonatomic) char selected2;
66 @interface Child : Parent
67 @property (nonatomic) char selected; // expected-warning {{property type 'char' is incompatible with type 'void *' inherited from 'MKAnnotationView'}} \
68 // expected-warning {{property type 'char' is incompatible with type 'void *' inherited from 'P2'}}
69 @property (nonatomic) char selected1; // expected-warning {{property type 'char' is incompatible with type 'void *' inherited from 'Parent'}}
70 @property (nonatomic) char selected2;