diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-11-08 20:58:53 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-11-08 20:58:53 +0000 |
commit | f21a92d35953adb038ffbe37cd1a4083e0df0ec0 (patch) | |
tree | 6d345ce9c429137693f82972c411862dc1fafb4a /lib/Sema/SemaObjCProperty.cpp | |
parent | 4c11772bb9e1bf7fb0cdf8fd3566314ef91baf8c (diff) |
objc-arc: 'readonly' property of retainable object
type is strong by default too. // rdar://10410903
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 46b2a086dd..4933f001c4 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -1770,13 +1770,12 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl, ObjCDeclSpec::DQ_PR_unsafe_unretained | ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong | ObjCDeclSpec::DQ_PR_weak)) && - !(Attributes & ObjCDeclSpec::DQ_PR_readonly) && PropertyTy->isObjCObjectPointerType()) { if (getLangOptions().ObjCAutoRefCount) // With arc, @property definitions should default to (strong) when - // not specified + // not specified; including when property is 'readonly'. PropertyDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong); - else { + else if (!(Attributes & ObjCDeclSpec::DQ_PR_readonly)) { // Skip this warning in gc-only mode. if (getLangOptions().getGC() != LangOptions::GCOnly) Diag(Loc, diag::warn_objc_property_no_assignment_attribute); |