aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaObjCProperty.cpp2
-rw-r--r--test/SemaObjC/tentative-property-decl.m4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 32fbb0432a..13350eaf37 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -612,7 +612,6 @@ DiagnoseClassAndClassExtPropertyMismatch(Sema &S, ObjCInterfaceDecl *ClassDecl,
bool warn = (Attributes & ObjCDeclSpec::DQ_PR_readonly);
for (const ObjCCategoryDecl *CDecl = ClassDecl->getFirstClassExtension();
CDecl; CDecl = CDecl->getNextClassExtension()) {
- warn = false;
ObjCPropertyDecl *ClassExtProperty = 0;
for (ObjCContainerDecl::prop_iterator P = CDecl->prop_begin(),
E = CDecl->prop_end(); P != E; ++P) {
@@ -622,6 +621,7 @@ DiagnoseClassAndClassExtPropertyMismatch(Sema &S, ObjCInterfaceDecl *ClassDecl,
}
}
if (ClassExtProperty) {
+ warn = false;
unsigned classExtPropertyAttr =
ClassExtProperty->getPropertyAttributesAsWritten();
// We are issuing the warning that we postponed because class extensions
diff --git a/test/SemaObjC/tentative-property-decl.m b/test/SemaObjC/tentative-property-decl.m
index 4ab2f56a4a..f69ac6dace 100644
--- a/test/SemaObjC/tentative-property-decl.m
+++ b/test/SemaObjC/tentative-property-decl.m
@@ -15,6 +15,7 @@
@interface MyClass : Super
@property(nonatomic, copy, readonly) NSString *prop;
+@property(nonatomic, copy, readonly) id warnProp; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
@end
@interface MyClass ()
@@ -23,11 +24,13 @@
@implementation MyClass
@synthesize prop;
+@synthesize warnProp;
@end
@protocol P
@property(nonatomic, copy, readonly) NSString *prop;
+@property(nonatomic, copy, readonly) id warnProp; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
@end
@interface YourClass : Super <P>
@@ -39,5 +42,6 @@
@implementation YourClass
@synthesize prop;
+@synthesize warnProp;
@end