79 lines · plain
1// RUN: %clang_cc1 -triple=x86_64-apple-macos10.10 -fsyntax-only -Wdeprecated-implementations -verify -Wno-objc-root-class %s2 3@protocol P4- (void) D __attribute__((deprecated)); // expected-note {{method 'D' declared here}}5 6- (void) unavailable __attribute__((__unavailable__)); // expected-note {{method 'unavailable' declared here}}7@end8 9@interface A <P>10+ (void)F __attribute__((deprecated));11@end12 13@interface A()14- (void) E __attribute__((deprecated));15@end16 17@implementation A18+ (void)F { } // No warning, implementing its own deprecated method19- (void) D {} // expected-warning {{implementing deprecated method}}20- (void) E {} // No warning, implementing deprecated method in its class extension.21 22- (void) unavailable { } // expected-warning {{implementing unavailable metho}}23@end24 25@interface A(CAT)26- (void) G __attribute__((deprecated)); 27@end28 29@implementation A(CAT)30- (void) G {} // No warning, implementing its own deprecated method31@end32 33__attribute__((deprecated)) // expected-note {{'CL' has been explicitly marked deprecated here}}34@interface CL // expected-note 2 {{class declared here}} 35@end36 37@implementation CL // expected-warning {{implementing deprecated class}}38@end39 40@implementation CL (SomeCategory) // expected-warning {{implementing deprecated category}}41@end42 43@interface CL_SUB : CL // expected-warning {{'CL' is deprecated}}44@end45 46@interface BASE47- (void) B __attribute__((deprecated)); // expected-note {{method 'B' declared here}}48 49+ (void) unavailable __attribute__((availability(macos, unavailable))); // expected-note {{method 'unavailable' declared here}}50@end51 52@interface SUB : BASE53@end54 55@implementation SUB56- (void) B {} // expected-warning {{implementing deprecated method}}57+ (void) unavailable { } // expected-warning {{implementing unavailable method}}58@end59 60@interface Test61@end62 63@interface Test()64- (id)initSpecialInPrivateHeader __attribute__((deprecated));65@end66 67@implementation Test68- (id)initSpecialInPrivateHeader {69 return (void *)0;70}71@end72 73__attribute__((deprecated))74@interface Test(DeprecatedCategory) // expected-note {{category declared here}}75@end76 77@implementation Test(DeprecatedCategory) // expected-warning {{implementing deprecated category}}78@end79