1 /* Test warnings when using -fobjc-std=objc1. */
2 /* { dg-do compile } */
3 /* { dg-options "-fobjc-std=objc1" } */
10 @package /* { dg-error "not available in Objective.C 1.0" } */
14 + (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) name { return self; }
25 - (id) init { return self; }
26 - (id) testMe: (id) __attribute__((unused)) argument { return self; } /* { dg-error "not available in Objective.C 1.0" } */
27 @synthesize a; /* { dg-error "not available in Objective.C 1.0" } */
28 @dynamic b; /* { dg-error "not available in Objective.C 1.0" } */
31 __attribute__ ((deprecated))
32 @interface MyRootClass2
33 { /* { dg-error "class attributes are not available in Objective.C 1.0" } */
38 __attribute__ ((deprecated))
40 - (id) test; /* { dg-error "protocol attributes are not available in Objective.C 1.0" } */
41 @required /* { dg-error "not available in Objective.C 1.0" } */
42 - (id) variable __attribute__ ((deprecated)); /* { dg-error "not available in Objective.C 1.0" } */
43 @optional /* { dg-error "not available in Objective.C 1.0" } */
46 @interface MyRootClass (NSFastEnumeration)
47 - (unsigned long)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state
48 objects:(id *)stackbuf
49 count:(unsigned int)len;
54 int array_length (NSArray *array)
58 for (id object in array) /* { dg-error "not available in Objective.C 1.0" } */
66 return MyRootClass.name; /* { dg-error "not available in Objective.C 1.0" } */
69 @interface MyRootClass3
75 @interface MyRootClass3 ()
76 @end /* { dg-error "not available in Objective.C 1.0" } */