[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / SemaObjC / warn-deprecated-implementations.m
blob440b2886f01dc966f7323f7e5b6bfb82e546215e
1 // RUN: %clang_cc1 -triple=x86_64-apple-macos10.10 -fsyntax-only -Wdeprecated-implementations -verify -Wno-objc-root-class %s
2 // rdar://8973810
3 // rdar://12717705
5 @protocol P
6 - (void) D __attribute__((deprecated)); // expected-note {{method 'D' declared here}}
8 - (void) unavailable __attribute__((__unavailable__)); // expected-note {{method 'unavailable' declared here}}
9 @end
11 @interface A <P>
12 + (void)F __attribute__((deprecated));
13 @end
15 @interface A()
16 - (void) E __attribute__((deprecated));
17 @end
19 @implementation A
20 + (void)F { }   // No warning, implementing its own deprecated method
21 - (void) D {} //  expected-warning {{implementing deprecated method}}
22 - (void) E {} // No warning, implementing deprecated method in its class extension.
24 - (void) unavailable { } // expected-warning {{implementing unavailable metho}}
25 @end
27 @interface A(CAT)
28 - (void) G __attribute__((deprecated)); 
29 @end
31 @implementation A(CAT)
32 - (void) G {}   // No warning, implementing its own deprecated method
33 @end
35 __attribute__((deprecated)) // expected-note {{'CL' has been explicitly marked deprecated here}}
36 @interface CL // expected-note 2 {{class declared here}} 
37 @end
39 @implementation CL // expected-warning {{implementing deprecated class}}
40 @end
42 @implementation CL (SomeCategory) // expected-warning {{implementing deprecated category}}
43 @end
45 @interface CL_SUB : CL // expected-warning {{'CL' is deprecated}}
46 @end
48 @interface BASE
49 - (void) B __attribute__((deprecated)); // expected-note {{method 'B' declared here}}
51 + (void) unavailable __attribute__((availability(macos, unavailable))); // expected-note {{method 'unavailable' declared here}}
52 @end
54 @interface SUB : BASE
55 @end
57 @implementation SUB
58 - (void) B {} // expected-warning {{implementing deprecated method}}
59 + (void) unavailable { } // expected-warning {{implementing unavailable method}}
60 @end
62 @interface Test
63 @end
65 @interface Test()
66 - (id)initSpecialInPrivateHeader __attribute__((deprecated));
67 @end
69 @implementation Test
70 - (id)initSpecialInPrivateHeader {
71   return (void *)0;
73 @end
75 __attribute__((deprecated))
76 @interface Test(DeprecatedCategory) // expected-note {{category declared here}}
77 @end
79 @implementation Test(DeprecatedCategory) // expected-warning {{implementing deprecated category}}
80 @end