2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -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}}
|
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
|
2011-02-15 08:59:30 +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.
|
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
|
|
|
|
|
2011-02-15 08:59:30 +08:00
|
|
|
__attribute__((deprecated))
|
2013-12-19 07:30:06 +08:00
|
|
|
@interface CL // expected-note 2 {{class declared here}} // expected-note 2 {{'CL' has been explicitly marked deprecated here}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation CL // expected-warning {{Implementing deprecated class}}
|
|
|
|
@end
|
|
|
|
|
2011-10-07 07:23:27 +08:00
|
|
|
@implementation CL ( SomeCategory ) // expected-warning {{'CL' is deprecated}} \
|
|
|
|
// 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}}
|
2011-02-15 08:59:30 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface SUB : BASE
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation SUB
|
|
|
|
- (void) B {} // expected-warning {{Implementing deprecated method}}
|
|
|
|
@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
|