objective-C: When checking for valid overriden property
in class extension, assume default is rewdwrite and don't
issue any diagnostics, privided other ownership models
are ok.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162583 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 98c1bb2..28b4dfa 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -661,7 +661,13 @@
       // property.
       if (Attributes & ObjCDeclSpec::DQ_PR_readonly) {
         if (!classExtPropertyAttr ||
-            (classExtPropertyAttr & ObjCDeclSpec::DQ_PR_readwrite))
+            (classExtPropertyAttr & 
+              (ObjCDeclSpec::DQ_PR_readwrite|
+               ObjCDeclSpec::DQ_PR_assign |
+               ObjCDeclSpec::DQ_PR_unsafe_unretained |
+               ObjCDeclSpec::DQ_PR_copy |
+               ObjCDeclSpec::DQ_PR_retain |
+               ObjCDeclSpec::DQ_PR_strong)))
           continue;
         warn = true;
         break;
diff --git a/test/SemaObjC/overriding-property-in-class-extension.m b/test/SemaObjC/overriding-property-in-class-extension.m
new file mode 100644
index 0000000..5cbc6d2
--- /dev/null
+++ b/test/SemaObjC/overriding-property-in-class-extension.m
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1  -fsyntax-only -verify -Weverything %s
+// rdar://12103434
+
+@class NSString;
+
+@interface NSObject @end
+
+@interface MyClass  : NSObject
+
+@property (nonatomic, copy, readonly) NSString* name;
+
+@end
+
+@interface MyClass () {
+    NSString* _name;
+}
+
+@property (nonatomic, copy) NSString* name;
+
+@end
+
+@implementation MyClass
+
+@synthesize name = _name;
+
+@end