]> granicus.if.org Git - clang/commitdiff
objc: Do not warn about mismatch on Super's readonly property attribute,
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 8 Oct 2011 17:45:33 +0000 (17:45 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 8 Oct 2011 17:45:33 +0000 (17:45 +0000)
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

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/arc-property-decl-attrs.m

index 7eb552c84a7b62ba5f772643daa4854a13abcea1..727c7b8b64c8c8da4c1e64b1417eab35deadb46e 100644 (file)
@@ -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));
index cc70780b7b84d879d8122baab1666ed19764bafd..1386241dd73c435268a47d7242391ebd2054d639 100644 (file)
 @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
+