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. */
8 #include <objc/runtime.h>
10 @interface MyRootClass
13 int countA : 2; /* { dg-message "originally specified here" } */
14 int countB : 3; /* { dg-message "originally specified here" } */
20 @property (nonatomic) short countB;
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-warning "method definition for ..setCountA.. not found" "" { target *-*-* } .-1 } */
31 /* { dg-warning "method definition for ..countA. not found" "" { target *-*-* } .-2 } */