1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-do compile } */
4 /* Test the 'dot syntax' without a declarated property. This tests
5 syntax errors in the case where the object is a Class. */
10 #include <objc/runtime.h>
15 @interface MyRootClass
23 + (void) setCount: (int)value;
25 + (void) setNext: (id)value;
28 @implementation MyRootClass
29 + (id) initialize { return self; }
30 + (id) alloc { return class_createInstance (self, 0); }
31 - (id) init { return self; }
36 + (void) setCount: (int)value
44 + (void) setNext: (id)value
52 MyRootClass *object = [[MyRootClass alloc] init];
54 MyRootClass.invalid = 40; /* { dg-error "could not find setter.getter" } */
55 if (MyRootClass.invalid != 40) /* { dg-error "could not find setter.getter" } */
58 MyRootClass.; /* { dg-error "expected identifier" } */
59 if (MyRootClass.) /* { dg-error "expected identifier" } */
62 MyRootClass.int; /* { dg-error "expected identifier" } */
63 /* { dg-error "expected" "" { target *-*-* } 62 } */
64 if (MyRootClass.int) /* { dg-error "expected identifier" } */
65 /* { dg-error "expected" "" { target *-*-* } 64 } */