1// RUN: %clang_cc1 -triple x86_64-apple-macosx10.8.0 -fsyntax-only -verify %s 2 3// This test case shows that 'availablity' and 'deprecated' does not inherit 4// when a property is redeclared in a subclass. This is intentional. 5 6@interface NSObject @end 7@protocol myProtocol 8@property int myProtocolProperty __attribute__((availability(macosx,introduced=10.7,deprecated=10.8))); // expected-note {{method 'myProtocolProperty' declared here}} \ 9 // expected-note {{property 'myProtocolProperty' is declared deprecated here}} 10@end 11 12@interface Foo : NSObject 13@property int myProperty __attribute__((availability(macosx,introduced=10.7,deprecated=10.8))); // expected-note {{'myProperty' declared here}} \ 14 // expected-note {{method 'myProperty' declared here}} \ 15 // expected-note {{property 'myProperty' is declared deprecated here}} 16@end 17 18@interface Bar : Foo <myProtocol> 19@property int myProperty; 20@property int myProtocolProperty; 21@end 22 23void test(Foo *y, Bar *x, id<myProtocol> z) { 24 y.myProperty = 0; // expected-warning {{'myProperty' is deprecated: first deprecated in OS X 10.8}} 25 [y myProperty]; // expected-warning {{'myProperty' is deprecated: first deprecated in OS X 10.8}} 26 27 x.myProperty = 1; // no-warning 28 [x myProperty]; // no-warning 29 30 x.myProtocolProperty = 0; // no-warning 31 32 [x myProtocolProperty]; // no-warning 33 [z myProtocolProperty]; // expected-warning {{'myProtocolProperty' is deprecated: first deprecated in OS X 10.8}} 34} 35