Author: fjahanian
Date: Mon Dec 8 12:47:29 2008
New Revision: 60709
URL: http://llvm.org/viewvc/llvm-project?rev=60709&view=rev
Log:
Since we do not allow a readonly property to be 'copy'retain', we
must allow the continuation class to extend it to a 'readwrite'
and 'copy/retain'.
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/test/SemaObjC/continuation-class-err.m
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=60709&r1=60708&r2=60709&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Mon Dec 8 12:47:29 2008
@@ -1388,11 +1388,7 @@
// with anonymous category's readwrite property attribute!
unsigned PIkind = PIDecl->getPropertyAttributes();
if (isReadWrite && (PIkind & ObjCPropertyDecl::OBJC_PR_readonly)) {
- if ((Attributes & ObjCPropertyDecl::OBJC_PR_retain) !=
- (PIkind & ObjCPropertyDecl::OBJC_PR_retain) ||
- (Attributes & ObjCPropertyDecl::OBJC_PR_copy) !=
- (PIkind & ObjCPropertyDecl::OBJC_PR_copy) ||
- (Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) !=
+ if ((Attributes & ObjCPropertyDecl::OBJC_PR_nonatomic) !=
(PIkind & ObjCPropertyDecl::OBJC_PR_nonatomic))
Diag(AtLoc, diag::warn_property_attr_mismatch);
PIDecl->makeitReadWriteAttribute();
Modified: cfe/trunk/test/SemaObjC/continuation-class-err.m
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/continuation-class-err.m?rev=60709&r1=60708&r2=60709&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/continuation-class-err.m (original)
+++ cfe/trunk/test/SemaObjC/continuation-class-err.m Mon Dec 8 12:47:29 2008
@@ -10,6 +10,6 @@
@end
@interface ReadOnly ()
[EMAIL PROTECTED](readwrite, copy) id object; // expected-warning {{property
attribute in continuation class does not match the primary class}}
[EMAIL PROTECTED](readwrite, copy) id object;
@property(readonly) id object1; // expected-error {{attribute of property in
continuation class of 'ReadOnly' can only be 'readwrite'}}
@end
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits