Fariborz Jahanian | c35b9e4 | 2008-04-21 21:05:54 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | @interface I |
| 4 | { |
| 5 | int IVAR; |
| 6 | } |
| 7 | @property int d1; |
| 8 | @property id prop_id; |
| 9 | @end |
| 10 | |
| 11 | @interface I(CAT) |
| 12 | @property int d1; |
| 13 | @end |
| 14 | |
| 15 | @implementation I |
| 16 | @synthesize d1; // expected-error {{property synthesize requires specification of an ivar}} |
| 17 | @dynamic bad; // expected-error {{property implementation must have its declaration in the class 'I'}} |
| 18 | @synthesize prop_id; // expected-error {{property synthesize requires specification of an ivar}} |
| 19 | @synthesize prop_id = IVAR; // expected-error {{type of property 'prop_id' does not match type of ivar 'IVAR'}} |
| 20 | @end |
| 21 | |
| 22 | @implementation I(CAT) |
| 23 | @synthesize d1; // expected-error {{@synthesize not allowed in a category's implementation}} |
| 24 | @dynamic bad; // expected-error {{property implementation must have its declaration in the category 'CAT'}} |
| 25 | @end |
| 26 | |
| 27 | @implementation E // expected-warning {{cannot find interface declaration for 'E'}} |
| 28 | @dynamic d; // expected-error {{property implementation must have its declaration in the class 'E'}} |
| 29 | @end |
| 30 | |
| 31 | @implementation Q(MYCAT) // expected-error {{cannot find interface declaration for 'Q'}} |
| 32 | @dynamic d; // expected-error {{property implementation in a category with no category declaration}} |
| 33 | @end |
| 34 | |
| 35 | |
| 36 | |