diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2008-04-21 21:05:54 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-04-21 21:05:54 +0000 |
| commit | f2a7d7c949a849b2ffb475e15cf71b629c1d6218 (patch) | |
| tree | e3aac05db3452eb4861926ea30a2b2cddf0638fe /clang/test/Sema | |
| parent | 74a58d780ad6cd523a0c07127efcbe53d0c1b5f4 (diff) | |
| download | bcm5719-llvm-f2a7d7c949a849b2ffb475e15cf71b629c1d6218.tar.gz bcm5719-llvm-f2a7d7c949a849b2ffb475e15cf71b629c1d6218.zip | |
Support for @dynamic AST build.
More property semantics checking.
First test case for ObjC2's property implementation.
llvm-svn: 50057
Diffstat (limited to 'clang/test/Sema')
| -rw-r--r-- | clang/test/Sema/objc-property-1.m | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/clang/test/Sema/objc-property-1.m b/clang/test/Sema/objc-property-1.m new file mode 100644 index 00000000000..d307d13022f --- /dev/null +++ b/clang/test/Sema/objc-property-1.m @@ -0,0 +1,36 @@ +// RUN: clang -fsyntax-only -verify %s + +@interface I +{ + int IVAR; +} +@property int d1; +@property id prop_id; +@end + +@interface I(CAT) +@property int d1; +@end + +@implementation I +@synthesize d1; // expected-error {{property synthesize requires specification of an ivar}} +@dynamic bad; // expected-error {{property implementation must have its declaration in the class 'I'}} +@synthesize prop_id; // expected-error {{property synthesize requires specification of an ivar}} +@synthesize prop_id = IVAR; // expected-error {{type of property 'prop_id' does not match type of ivar 'IVAR'}} +@end + +@implementation I(CAT) +@synthesize d1; // expected-error {{@synthesize not allowed in a category's implementation}} +@dynamic bad; // expected-error {{property implementation must have its declaration in the category 'CAT'}} +@end + +@implementation E // expected-warning {{cannot find interface declaration for 'E'}} +@dynamic d; // expected-error {{property implementation must have its declaration in the class 'E'}} +@end + +@implementation Q(MYCAT) // expected-error {{cannot find interface declaration for 'Q'}} +@dynamic d; // expected-error {{property implementation in a category with no category declaration}} +@end + + + |

