From: Fariborz Jahanian Date: Mon, 8 Dec 2008 18:47:29 +0000 (+0000) Subject: Since we do not allow a readonly property to be 'copy'retain', we X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9bfb2a2cbe3931db9785705c6d476c3089eaeed6;p=clang 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'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60709 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 7a93b453f0..828e1fc8c6 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -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(); diff --git a/test/SemaObjC/continuation-class-err.m b/test/SemaObjC/continuation-class-err.m index 1ddbd62365..bd60f55f0c 100644 --- a/test/SemaObjC/continuation-class-err.m +++ b/test/SemaObjC/continuation-class-err.m @@ -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