diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-10-08 17:45:33 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-10-08 17:45:33 +0000 |
commit | 1b46d8d78be713c546fb9680eaeea8f793bee5bf (patch) | |
tree | 10b84af161a0d437f77ebd5a339194cf6f24bb85 | |
parent | 54dec5f9ad13597bbebb6872ab938e2ad4b6aa1b (diff) |
objc: Do not warn about mismatch on Super's readonly property attribute,
related to a readwrite property, and
Sub's readwrite property. // rdar://9396329
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141497 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 2 | ||||
-rw-r--r-- | test/SemaObjC/arc-property-decl-attrs.m | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 7eb552c84a..727c7b8b64 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -899,7 +899,7 @@ Sema::DiagnosePropertyMismatch(ObjCPropertyDecl *Property, != (SAttr & ObjCPropertyDecl::OBJC_PR_copy)) Diag(Property->getLocation(), diag::warn_property_attribute) << Property->getDeclName() << "copy" << inheritedName; - else { + else if (!(SAttr & ObjCPropertyDecl::OBJC_PR_readonly)){ unsigned CAttrRetain = (CAttr & (ObjCPropertyDecl::OBJC_PR_retain | ObjCPropertyDecl::OBJC_PR_strong)); diff --git a/test/SemaObjC/arc-property-decl-attrs.m b/test/SemaObjC/arc-property-decl-attrs.m index cc70780b7b..1386241dd7 100644 --- a/test/SemaObjC/arc-property-decl-attrs.m +++ b/test/SemaObjC/arc-property-decl-attrs.m @@ -65,3 +65,17 @@ @property(unsafe_unretained) __weak id y; // expected-error {{property attributes 'unsafe_unretained' and 'weak' are mutually exclusive}} @property(unsafe_unretained) __autoreleasing id z; // expected-error {{unsafe_unretained property 'z' may not also be declared __autoreleasing}} @end + +// rdar://9396329 +@interface Super +@property (readonly, retain) id foo; +@property (readonly, weak) id fee; +@property (readonly, strong) id frr; +@end + +@interface Bugg : Super +@property (readwrite) id foo; +@property (readwrite) id fee; +@property (readwrite) id frr; +@end + |