1 | // RUN: %clang_cc1 -fsyntax-only -fblocks -verify -Wno-objc-root-class %s |
2 | // rdar://10414277 |
3 | |
4 | @protocol P |
5 | void p_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}} |
6 | @end |
7 | |
8 | @interface I |
9 | void foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}} |
10 | inline void v_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}} |
11 | static int s_foo() {return 0; } // expected-warning {{function definition inside an Objective-C container is deprecated}} |
12 | static inline int si_val() { return 1; } // expected-warning {{function definition inside an Objective-C container is deprecated}} |
13 | @end |
14 | |
15 | @interface I(CAT) |
16 | void cat_foo() {} // expected-warning {{function definition inside an Objective-C container is deprecated}} |
17 | @end |
18 | |
19 | @implementation I |
20 | inline void v_imp_foo() {} |
21 | @end |
22 | |
23 | @implementation I(CAT) |
24 | void cat_imp_foo() {} |
25 | @end |
26 | |
27 | // rdar://16859666 |
28 | @interface PrototypeState |
29 | |
30 | @property (strong, readwrite) id moin1; // expected-note {{property declared here}} |
31 | |
32 | static inline void prototype_observe_moin1(void (^callback)(id)) { // expected-warning {{function definition inside an Objective-C container is deprecated}} |
33 | (void)^(PrototypeState *prototypeState){ |
34 | callback(prototypeState.moin1); // expected-error {{use of Objective-C property in function nested in Objective-C container not supported, move function outside its container}} |
35 | }; |
36 | } |
37 | @end |
38 | |