1 /* Test warnings when using -fobjc-std=objc1. */
2 /* { dg-do compile } */
3 /* { dg-options "-fobjc-std=objc1" } */
7 __attribute__ ((deprecated))
9 { /* { dg-error "class attributes are not available in Objective.C 1.0" } */
11 @package /* { dg-error "not available in Objective.C 1.0" } */
15 + (id) alloc __attribute__ ((deprecated)); /* { dg-error "not available in Objective.C 1.0" } */
17 - (id) testMe: (id) __attribute__((unused)) argument; /* { dg-error "not available in Objective.C 1.0" } */
18 @property (nonatomic) int a; /* { dg-error "not available in Objective.C 1.0" } */
19 @property (nonatomic) int b; /* { dg-error "not available in Objective.C 1.0" } */
22 @implementation MyRootClass
23 + (id) alloc { return self; }
24 - (id) init { return self; }
25 - (id) testMe: (id) __attribute__((unused)) argument { return self; } /* { dg-error "not available in Objective.C 1.0" } */
26 @synthesize a; /* { dg-error "not available in Objective.C 1.0" } */
27 @dynamic b; /* { dg-error "not available in Objective.C 1.0" } */
30 __attribute__ ((deprecated))
32 - (id) test; /* { dg-error "protocol attributes are not available in Objective.C 1.0" } */
33 @required /* { dg-error "not available in Objective.C 1.0" } */
34 - (id) variable __attribute__ ((deprecated)); /* { dg-error "not available in Objective.C 1.0" } */
35 @optional /* { dg-error "not available in Objective.C 1.0" } */
38 @interface MyRootClass (NSFastEnumeration)
39 - (unsigned long)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state
40 objects:(id *)stackbuf
41 count:(unsigned int)len;
46 int array_length (NSArray *array)
50 for (id object in array) /* { dg-error "not available in Objective.C 1.0" } */