]> granicus.if.org Git - clang/commitdiff
Since we do not allow a readonly property to be 'copy'retain', we
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 8 Dec 2008 18:47:29 +0000 (18:47 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 8 Dec 2008 18:47:29 +0000 (18:47 +0000)
must allow the continuation class to extend it to a 'readwrite'
and 'copy/retain'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60709 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclObjC.cpp
test/SemaObjC/continuation-class-err.m

index 7a93b453f07ccb5083429bc61f387d50c947a225..828e1fc8c612d113e7f94d3f815b4a2b572c8148 100644 (file)
@@ -1388,11 +1388,7 @@ Sema::DeclTy *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
           // 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();
index 1ddbd6236522505a2cf5f470d73b22282ec3e01d..bd60f55f0cc17c8684062ca9eb120e25f51360de 100644 (file)
@@ -10,6 +10,6 @@
 @end
 
 @interface ReadOnly ()
-@property(readwrite, copy) id object;  // expected-warning {{property attribute in continuation class does not match the primary class}}
+@property(readwrite, copy) id object;  
 @property(readonly) id object1; // expected-error {{attribute of property in continuation class of 'ReadOnly' can only  be 'readwrite'}}
 @end