Debian Codegraph @

gcc/testsuite/objc.dg/enhanced-proto-2.m

raw
1 /* Test use of @optional/@required keywords in @protocol class. */
2 /* { dg-do compile } */
3 /* { dg-additional-options "-Wno-objc-root-class" } */
4
5 @protocol MyProto1
6 @optional
7 - (void) FOO;
8 @optional
9 - (void) FOO;
10 @optional
11 - (void) REQ;
12 @optional
13 @end
14
15 @interface MyProto2 <MyProto1>
16 @required /* { dg-error ".@required. is allowed in @protocol context only" } */
17 - (void) FOO2;
18 @optional /* { dg-error ".@optional. is allowed in @protocol context only" } */
19 - (void) FOO3;
20 @end
21
22 @implementation MyProto2
23 - (void) FOO2{}
24 - (void) FOO3{}
25 @end