diff options
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 8 | ||||
-rw-r--r-- | test/SemaObjC/overriding-property-in-class-extension.m | 26 |
2 files changed, 33 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 98c1bb27f9..28b4dfa0cc 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -661,7 +661,13 @@ DiagnoseClassAndClassExtPropertyMismatch(Sema &S, ObjCInterfaceDecl *ClassDecl, // 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 0000000000..5cbc6d2ceb --- /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 |