Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / obj-c++.dg / property / synthesize-1.mm
blob3513c016e72063bce0f94bb5316223b06d628a21
1 /* { dg-do compile } */
3 #include <objc/objc.h>
5 @interface MyRootClass
7   Class isa;
9 @end
11 @implementation MyRootClass
12 @end
14 @synthesize isa;                    /* { dg-error "misplaced .@synthesize. Objective-C.. construct" } */
16 @interface Test : MyRootClass
18   int v1;
19   int v2;
20   int v3;
21   int v4;
22   int v5;
23   int v6;
24   int v7;
25   int v8;
27 @property int v1;
28 @property int v2;
29 @property int v3;
30 @property int v4;
31 @property int v5;
32 @property int v6;
33 @property int v7;
34 @property int v8;
35 @end
37 @implementation Test
38 @synthesize;                        /* { dg-error "expected identifier" } */
39 @synthesize v1, ;                   /* { dg-error "expected identifier" } */
40 @synthesize v2, v3 = ;              /* { dg-error "expected identifier" } */
41 @synthesize v4, v5=v6, v6 = v5,v7;
42 @synthesize v8;       
43 /* Some of the @synthesize above will fail due to syntax errors.  The
44    compiler will then complain that the methods implementing the
45    properties are missing.  That is correct, but we are not
46    interested.  The following ones shut up the compiler.  */
47 - (int) v1 { return v1; }
48 - (void) setV1: (int)a { v1 = a; }
49 - (int) v2 { return v2; }
50 - (void) setV2: (int)a { v2 = a; }
51 - (int) v3 { return v3; }
52 - (void) setV3: (int)a { v3 = a; }
53 @end