Debian Codegraph @

clang/test/SemaObjC/deprecate_function_containers.m

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