1 /* Test warnings when using -fobjc-std=objc1. */
2 /* { dg-do compile } */
3 /* { dg-options "-fobjc-std=objc1" } */
4 /* { dg-additional-options "-Wno-objc-root-class" } */
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" } */
18 - (id) testMe: (id) __attribute__((unused)) argument; /* { dg-error "not available in Objective.C 1.0" } */
19 @property (nonatomic) int a; /* { dg-error "not available in Objective.C 1.0" } */
20 @property (nonatomic) int b; /* { dg-error "not available in Objective.C 1.0" } */
23 @implementation MyRootClass
24 + (id) alloc { return self; }
25 + (id) name { return self; }
26 - (id) init { return self; }
27 - (id) testMe: (id) __attribute__((unused)) argument { return self; } /* { dg-error "not available in Objective.C 1.0" } */
28 @synthesize a; /* { dg-error "not available in Objective.C 1.0" } */
29 @dynamic b; /* { dg-error "not available in Objective.C 1.0" } */
32 __attribute__ ((deprecated))
33 @interface MyRootClass2 /* { dg-error "class attributes are not available in Objective.C 1.0" } */
39 __attribute__ ((deprecated))
41 - (id) test; /* { dg-error "protocol attributes are not available in Objective.C 1.0" } */
42 @required /* { dg-error "not available in Objective.C 1.0" } */
43 - (id) variable __attribute__ ((deprecated)); /* { dg-error "not available in Objective.C 1.0" } */
44 @optional /* { dg-error "not available in Objective.C 1.0" } */
47 @interface MyRootClass (NSFastEnumeration)
48 - (unsigned long)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state
49 objects:(id *)stackbuf
50 count:(unsigned int)len;
55 int array_length (NSArray *array)
59 for (id object in array) /* { dg-error "not available in Objective.C 1.0" } */
67 return MyRootClass.name; /* { dg-error "not available in Objective.C 1.0" } */
70 @interface MyRootClass3
76 @interface MyRootClass3 ()
77 @end /* { dg-error "not available in Objective.C 1.0" } */