1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-do compile } */
4 /* Test that when using @synthesize the instance variable and the
5 property have exactly the same type. */
16 @interface ClassB : ClassA
30 ClassA <MyProtocol> *c;
32 @property (assign) int v;
33 @property (assign) float w;
34 @property (assign) id x;
35 @property (assign) Test *y;
36 @property (assign) id <MyProtocol> *z;
37 @property (assign) ClassA *a;
38 @property (assign) ClassB *b;
55 int v; /* { dg-warning "originally specified here" } */
56 float w; /* { dg-warning "originally specified here" } */
57 id x; /* { dg-warning "originally specified here" } */
58 Test *y; /* { dg-warning "originally specified here" } */
59 id <MyProtocol> *z; /* { dg-warning "originally specified here" } */
60 ClassA *a; /* { dg-warning "originally specified here" } */
61 ClassB *b; /* { dg-warning "originally specified here" } */
63 @property (assign) float v;
64 @property (assign) id w;
65 @property (assign) int x;
66 @property (assign) id y;
67 @property (assign) Test *z;
68 @property (assign) ClassB *a;
69 @property (assign) ClassA *b;
73 @synthesize v; /* { dg-error "property .v. is using instance variable .v. of incompatible type" } */
74 @synthesize w; /* { dg-error "property .w. is using instance variable .w. of incompatible type" } */
75 @synthesize x; /* { dg-error "property .x. is using instance variable .x. of incompatible type" } */
76 @synthesize y; /* { dg-error "property .y. is using instance variable .y. of incompatible type" } */
77 @synthesize z; /* { dg-error "property .z. is using instance variable .z. of incompatible type" } */
78 @synthesize a; /* { dg-error "property .a. is using instance variable .a. of incompatible type" } */
79 @synthesize b; /* { dg-error "property .b. is using instance variable .b. of incompatible type" } */