OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / enhanced-proto-2.m
1 /* Test use of @optional/@required keywords in @protocol class. */
2 /* { dg-do compile } */
3
4 @protocol MyProto1 
5 @optional
6 - (void) FOO;
7 @optional
8 - (void) FOO;
9 @optional 
10 - (void) REQ;
11 @optional
12 @end
13
14 @interface  MyProto2 <MyProto1>
15 @required               /* { dg-error ".@required. is allowed in @protocol context only" }  */
16 - (void) FOO2;
17 @optional               /* { dg-error ".@optional. is allowed in @protocol context only" }  */
18 - (void) FOO3;
19 @end
20
21 @implementation MyProto2
22 - (void) FOO2{}
23 - (void) FOO3{}
24 @end