2013-10-29 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / obj-c++.dg / property / dynamic-2.mm
blob49004eff4951fef9fc8e1e3fd4750969ea5d5a61
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
2 /* { dg-do compile } */
4 #include <objc/objc.h>
6 @interface MyRootClass
8   Class isa;
10 @end
12 @implementation MyRootClass
13 @end
15 @dynamic isa;  /* { dg-error "misplaced .@dynamic. Objective-C.. construct" } */
17 @interface Test : MyRootClass
19   int v1;
21 @end
22 @implementation Test
23 @end
26 @interface Test (Category)
27 @property int v1;
28 @end
29 @implementation Test (Category)
30 @dynamic v1;
31 @end
34 @interface AnotherTest : MyRootClass
37 @property int one;
38 @end
40 @implementation AnotherTest
41 @dynamic one;
42 @dynamic one; /* { dg-error "property .one. already specified in .@dynamic." } */
43               /* { dg-message "originally specified here" "" { target *-*-* } 41 } */
44 @dynamic three; /* { dg-error "no declaration of property .three. found in the interface" } */
45 @end