diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-06 00:18:12 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-01-06 00:18:12 +0000 |
commit | 1a5f292fbfcae4b6ddd6ba3fb3b03d068845c70e (patch) | |
tree | 236effd71c0f5edc47d58a4f882801cfeaa3b26a /clang/lib | |
parent | 578865ff3d2dcdd79f4df4329703c262920de5dc (diff) | |
download | bcm5719-llvm-1a5f292fbfcae4b6ddd6ba3fb3b03d068845c70e.tar.gz bcm5719-llvm-1a5f292fbfcae4b6ddd6ba3fb3b03d068845c70e.zip |
Do not diagnose method disguised as property setter
for a 'readonly' property. Fixes radar 7427072.
llvm-svn: 92808
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index fb2cc712dce..115a4333031 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -1473,8 +1473,11 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, property->getLocation()); if (SetterMethod) { - if (Context.getCanonicalType(SetterMethod->getResultType()) - != Context.VoidTy) + ObjCPropertyDecl::PropertyAttributeKind CAttr = + property->getPropertyAttributes(); + if ((!(CAttr & ObjCPropertyDecl::OBJC_PR_readonly)) && + Context.getCanonicalType(SetterMethod->getResultType()) != + Context.VoidTy) Diag(SetterMethod->getLocation(), diag::err_setter_type_void); if (SetterMethod->param_size() != 1 || ((*SetterMethod->param_begin())->getType() != property->getType())) { |