aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/property/dynamic-2.mm
blob: 49004eff4951fef9fc8e1e3fd4750969ea5d5a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
/* { dg-do compile } */

#include <objc/objc.h>

@interface MyRootClass
{
  Class isa;
}
@end

@implementation MyRootClass
@end

@dynamic isa;  /* { dg-error "misplaced .@dynamic. Objective-C.. construct" } */

@interface Test : MyRootClass
{
  int v1;
}
@end
@implementation Test
@end


@interface Test (Category)
@property int v1;
@end
@implementation Test (Category)
@dynamic v1;
@end


@interface AnotherTest : MyRootClass
{
}
@property int one;
@end

@implementation AnotherTest
@dynamic one;
@dynamic one; /* { dg-error "property .one. already specified in .@dynamic." } */
              /* { dg-message "originally specified here" "" { target *-*-* } 41 } */
@dynamic three; /* { dg-error "no declaration of property .three. found in the interface" } */
@end