1 // RUN: %clang_cc1 -fsyntax-only -Wno-objc-root-class -verify %s
4 - (void)newProtocolMethod;
5 - (void)deprecatedProtocolMethod __attribute__((deprecated)); // expected-note 2 {{'deprecatedProtocolMethod' has been explicitly marked deprecated here}}
8 @interface NSObject @end
10 @interface TestClass : NSObject <TestProtocol>
12 - (void)newInstanceMethod;
13 - (void)deprecatedInstanceMethod __attribute__((deprecated)); // expected-note {{'deprecatedInstanceMethod' has been explicitly marked deprecated here}}
17 int main(int argc, const char * argv[])
20 TestClass *testObj = (TestClass*)0;
21 [testObj newInstanceMethod];
22 [testObj deprecatedInstanceMethod]; // expected-warning {{'deprecatedInstanceMethod' is deprecated}}
24 [testObj newProtocolMethod];
25 [testObj deprecatedProtocolMethod]; // expected-warning {{'deprecatedProtocolMethod' is deprecated}}
27 id <TestProtocol> testProto = testObj;
28 [testProto newProtocolMethod];
29 [testProto deprecatedProtocolMethod]; // expected-warning {{'deprecatedProtocolMethod' is deprecated}}