diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-03-22 23:25:52 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-03-22 23:25:52 +0000 |
commit | 22f757b38da3fc9f17ea9e99524064fdfbca3456 (patch) | |
tree | fb3086eb1761c752a36724b33db8e0c5dcaa5600 /lib/Sema/SemaObjCProperty.cpp | |
parent | b0f65ca9853d1148211a38736141c8ccf2aa4a1d (diff) |
Set the relevent attributes declared in class extension
and fix a missing diagnostics on assigning to a read-only
property. Fixes radar 7766184.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99230 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 41ed6c630c..030fdaafbc 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -93,6 +93,11 @@ Sema::HandlePropertyInClassExtension(Scope *S, ObjCCategoryDecl *CDecl, ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, DC, FD.D.getIdentifierLoc(), PropertyId, AtLoc, T); + if (Attributes & ObjCDeclSpec::DQ_PR_readonly) + PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly); + if (Attributes & ObjCDeclSpec::DQ_PR_readwrite) + PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite); + DC->addDecl(PDecl); // We need to look in the @interface to see if the @property was |