Fariborz Jahanian | 33e6c2d | 2012-06-23 18:39:57 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wno-objc-root-class -verify %s |
| 2 | // rdar://11618852 |
| 3 | |
| 4 | @protocol TestProtocol |
| 5 | - (void)newProtocolMethod; |
| 6 | - (void)deprecatedProtocolMethod __attribute__((deprecated)); // expected-note 2 {{method 'deprecatedProtocolMethod' declared here}} |
| 7 | @end |
| 8 | |
| 9 | @interface NSObject @end |
| 10 | |
| 11 | @interface TestClass : NSObject <TestProtocol> |
| 12 | |
| 13 | - (void)newInstanceMethod; |
| 14 | - (void)deprecatedInstanceMethod __attribute__((deprecated)); // expected-note {{method 'deprecatedInstanceMethod' declared here}} |
| 15 | |
| 16 | @end |
| 17 | |
| 18 | int main(int argc, const char * argv[]) |
| 19 | { |
| 20 | |
| 21 | TestClass *testObj = (TestClass*)0; |
| 22 | [testObj newInstanceMethod]; |
| 23 | [testObj deprecatedInstanceMethod]; // expected-warning {{'deprecatedInstanceMethod' is deprecated}} |
| 24 | |
| 25 | [testObj newProtocolMethod]; |
| 26 | [testObj deprecatedProtocolMethod]; // expected-warning {{'deprecatedProtocolMethod' is deprecated}} |
| 27 | |
| 28 | id <TestProtocol> testProto = testObj; |
| 29 | [testProto newProtocolMethod]; |
| 30 | [testProto deprecatedProtocolMethod]; // expected-warning {{'deprecatedProtocolMethod' is deprecated}} |
| 31 | return 0; |
| 32 | } |