2017-07-14 00:37:11 +08:00
|
|
|
// RUN: %clang_cc1 -triple=x86_64-apple-macos10.10 -fsyntax-only -Wdeprecated-implementations -verify -Wno-objc-root-class %s
|
2011-02-15 08:59:30 +08:00
|
|
|
// rdar://8973810
|
2012-11-18 04:53:53 +08:00
|
|
|
// rdar://12717705
|
2011-02-15 08:59:30 +08:00
|
|
|
|
|
|
|
@protocol P
|
2012-02-28 06:55:11 +08:00
|
|
|
- (void) D __attribute__((deprecated)); // expected-note {{method 'D' declared here}}
|
2017-07-14 00:37:11 +08:00
|
|
|
|
|
|
|
- (void) unavailable __attribute__((__unavailable__)); // expected-note {{method 'unavailable' declared here}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface A <P>
|
2012-11-18 04:53:53 +08:00
|
|
|
+ (void)F __attribute__((deprecated));
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface A()
|
2014-03-18 08:10:37 +08:00
|
|
|
- (void) E __attribute__((deprecated));
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A
|
2012-11-18 04:53:53 +08:00
|
|
|
+ (void)F { } // No warning, implementing its own deprecated method
|
2017-07-14 00:35:59 +08:00
|
|
|
- (void) D {} // expected-warning {{implementing deprecated method}}
|
2014-03-18 08:10:37 +08:00
|
|
|
- (void) E {} // No warning, implementing deprecated method in its class extension.
|
2017-07-14 00:37:11 +08:00
|
|
|
|
|
|
|
- (void) unavailable { } // expected-warning {{implementing unavailable metho}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
2012-11-18 04:53:53 +08:00
|
|
|
@interface A(CAT)
|
|
|
|
- (void) G __attribute__((deprecated));
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A(CAT)
|
|
|
|
- (void) G {} // No warning, implementing its own deprecated method
|
|
|
|
@end
|
|
|
|
|
2017-05-31 23:45:57 +08:00
|
|
|
__attribute__((deprecated)) // expected-note {{'CL' has been explicitly marked deprecated here}}
|
2017-03-24 02:51:54 +08:00
|
|
|
@interface CL // expected-note 2 {{class declared here}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
2017-07-14 00:35:59 +08:00
|
|
|
@implementation CL // expected-warning {{implementing deprecated class}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
2017-07-14 00:35:59 +08:00
|
|
|
@implementation CL (SomeCategory) // expected-warning {{implementing deprecated category}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface CL_SUB : CL // expected-warning {{'CL' is deprecated}}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface BASE
|
2012-02-28 06:55:11 +08:00
|
|
|
- (void) B __attribute__((deprecated)); // expected-note {{method 'B' declared here}}
|
2017-07-14 00:37:11 +08:00
|
|
|
|
|
|
|
+ (void) unavailable __attribute__((availability(macos, unavailable))); // expected-note {{method 'unavailable' declared here}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface SUB : BASE
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation SUB
|
2017-07-14 00:35:59 +08:00
|
|
|
- (void) B {} // expected-warning {{implementing deprecated method}}
|
2017-07-14 00:37:11 +08:00
|
|
|
+ (void) unavailable { } // expected-warning {{implementing unavailable method}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
2014-03-18 08:10:37 +08:00
|
|
|
@interface Test
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Test()
|
|
|
|
- (id)initSpecialInPrivateHeader __attribute__((deprecated));
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Test
|
|
|
|
- (id)initSpecialInPrivateHeader {
|
|
|
|
return (void *)0;
|
|
|
|
}
|
|
|
|
@end
|
2017-03-23 19:44:25 +08:00
|
|
|
|
|
|
|
__attribute__((deprecated))
|
|
|
|
@interface Test(DeprecatedCategory) // expected-note {{category declared here}}
|
|
|
|
@end
|
|
|
|
|
2017-07-14 00:35:59 +08:00
|
|
|
@implementation Test(DeprecatedCategory) // expected-warning {{implementing deprecated category}}
|
2017-03-23 19:44:25 +08:00
|
|
|
@end
|