1 /* Test warnings when using -fobjc-std=objc1. */
2 /* { dg-do compile } */
3 /* { dg-options "-fobjc-std=objc1" } */
9 Class isa; /* { dg-error ".@package. is 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 /* There is a problem with the testsuite on the following line; the compiler seems Ok, but the testsuite still barfs. */
28 /*@synthesize a;*/ /* dg-error "not available in Objective.C 1.0" */
29 /* The following lines replace the synthesize to prevent warnings. */
30 - (int) a { return a; }
31 - (void) setA: (int)value { a = value; }
32 @dynamic b; /* { dg-error "not available in Objective.C 1.0" } */
35 __attribute__ ((deprecated))
36 @interface MyRootClass2 /* { dg-error "class attributes are not available in Objective.C 1.0" } */
42 __attribute__ ((deprecated))
43 @protocol MyProtocol /* { dg-error "protocol attributes are not available in Objective.C 1.0" } */
45 @required /* { dg-error "not available in Objective.C 1.0" } */
46 - (id) variable __attribute__ ((deprecated)); /* { dg-error "not available in Objective.C 1.0" } */
47 @optional /* { dg-error "not available in Objective.C 1.0" } */
49 #if 0 /* fast enumeration is not implemented even in Objective-C 2.0 */
50 @interface MyRootClass (NSFastEnumeration)
51 - (unsigned long)countByEnumeratingWithState: (struct __objcFastEnumerationState *)state
52 objects:(id *)stackbuf
53 count:(unsigned int)len;
58 int array_length (NSArray *array)
62 for (id object in array) /* dg-error "not available in Objective.C 1.0" */
71 return MyRootClass.name; /* { dg-error "not available in Objective.C 1.0" } */
74 @interface MyRootClass3
80 /* There is a problem with the testsuite on the following line; the compiler seems Ok, but the testsuite still barfs. */
81 /* @interface MyRootClass3 () */ /* dg-error "not available in Objective.C 1.0" */