* tree-loop-distribution.c (struct partition): New field recording
[official-gcc.git] / gcc / testsuite / obj-c++.dg / property / synthesize-11.mm
blob3f02112643f6c037f7c8526661a86cfa2090ef30
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
2 /* { dg-do compile } */
4 /* Test errors when @synthesize is used with bitfield instance variables in an incorrect way.  */
6 #include <stdlib.h>
7 #include <objc/objc.h>
8 #include <objc/runtime.h>
10 @interface MyRootClass
12   Class isa;
13   int countA : 2;                  /* { dg-message "originally specified here" } */
14   int countB : 3;                  /* { dg-message "originally specified here" } */
16 + (id) initialize;
17 + (id) alloc;
18 - (id) init;
19 @property int countA;       
20 @property (nonatomic) short countB;
21 @end
23 @implementation MyRootClass
24 + (id) initialize { return self; }
25 + (id) alloc { return class_createInstance (self, 0); }
26 - (id) init { return self; }
27 @synthesize countA; /* { dg-error ".atomic. property .countA. is using bit-field instance variable .countA." } */
28 @synthesize countB; /* { dg-error "property .countB. is using instance variable .countB. of incompatible type" } */
29 @end /* { dg-warning "incomplete implementation of class" } */
30 /* { dg-message "method definition for ..setCountA.. not found" "" { target *-*-* } .-1 } */
31 /* { dg-message "method definition for ..countA. not found" "" { target *-*-* } .-2 } */