1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-do compile } */
6 /* Test that if you have a property declared in a class and a
7 sub-class, the attributes match. */
13 @property (assign) id a; /* { dg-message "originally specified here" } */
14 @property (retain) id b; /* { dg-message "originally specified here" } */
15 @property int c; /* { dg-message "originally specified here" } */
16 @property (nonatomic) int d; /* { dg-message "originally specified here" } */
17 @property int e; /* { dg-message "originally specified here" } */
18 @property int f; /* { dg-message "originally specified here" } */
19 @property int g; /* { dg-message "originally specified here" } */
20 @property (readonly) int h; /* Ok */
21 @property (readonly,getter=getMe) int i; /* { dg-message "originally specified here" } */
24 @interface MyClass : MyRootClass
25 @property (assign) id a;
26 @property (retain) id b;
28 @property (nonatomic) int d;
32 @property (readonly) int h;
33 @property (readonly,getter=getMe) int i;
36 @interface MyClass2 : MyRootClass
37 @property (retain) id a; /* { dg-warning "assign semantics attributes of property .a. conflict with previous declaration" } */
38 @property (assign) id b; /* { dg-warning "assign semantics attributes of property .b. conflict with previous declaration" } */
39 @property (nonatomic) int c; /* { dg-warning ".nonatomic. attribute of property .c. conflicts with previous declaration" } */
40 @property int d; /* { dg-warning ".nonatomic. attribute of property .d. conflicts with previous declaration" } */
41 @property (setter=setX:) int e; /* { dg-warning ".setter. attribute of property .e. conflicts with previous declaration" } */
42 @property (getter=x) int f; /* { dg-warning ".getter. attribute of property .f. conflicts with previous declaration" } */
43 @property (readonly) int g; /* { dg-warning ".readonly. attribute of property .g. conflicts with previous declaration" } */
44 @property (readwrite) int h; /* Ok */
45 @property (readonly) int i; /* { dg-warning ".getter. attribute of property .i. conflicts with previous declaration" } */