diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-04-21 21:57:36 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-04-21 21:57:36 +0000 |
commit | c6bec7b6dc41b13ee9c4eae5e183c2cccc34f443 (patch) | |
tree | a3cd9590275846bc40d0dbfed328e34b7f6bc24d /clang/test | |
parent | f386da0aec8d126ea09dc532c0442444aa77c5a6 (diff) | |
download | bcm5719-llvm-c6bec7b6dc41b13ee9c4eae5e183c2cccc34f443.tar.gz bcm5719-llvm-c6bec7b6dc41b13ee9c4eae5e183c2cccc34f443.zip |
More semantics checks of properties. Property implementation can implicitly use
ivar of same name.
Better diagnostics to bring home this point.
llvm-svn: 50065
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/objc-property-1.m | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/test/Sema/objc-property-1.m b/clang/test/Sema/objc-property-1.m index d307d13022f..3bc2e3386b0 100644 --- a/clang/test/Sema/objc-property-1.m +++ b/clang/test/Sema/objc-property-1.m @@ -3,9 +3,11 @@ @interface I { int IVAR; + int name; } @property int d1; @property id prop_id; +@property int name; @end @interface I(CAT) @@ -13,10 +15,11 @@ @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 d1; // expected-error {{synthesized property 'd1' must either be named the same as}} +@dynamic bad; // expected-error {{property implementation must have its declaration in interface 'I'}} +@synthesize prop_id; // expected-error {{synthesized property 'prop_id' must either be named the same}} @synthesize prop_id = IVAR; // expected-error {{type of property 'prop_id' does not match type of ivar 'IVAR'}} +@synthesize name; // OK! property with same name as an accessible ivar of same name @end @implementation I(CAT) @@ -25,7 +28,7 @@ @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'}} +@dynamic d; // expected-error {{property implementation must have its declaration in interface 'E'}} @end @implementation Q(MYCAT) // expected-error {{cannot find interface declaration for 'Q'}} |