diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-11-01 23:02:16 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-11-01 23:02:16 +0000 |
commit | 48a98c7a8467a9570d2fc7f2aab7f5273a3e218e (patch) | |
tree | 56d4abab34d493a8882f4b05c6b9ad57b34c9ed8 /lib/Sema/SemaObjCProperty.cpp | |
parent | 6800ba622e4edf287801ac69c42c61e7e294b06b (diff) |
objc: warn if a readonly property has a setter attribute too.
// rdar://10357768
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143518 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 617dbefada..ae054bc629 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -1798,4 +1798,9 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl, !(Attributes & ObjCDeclSpec::DQ_PR_strong) && PropertyTy->isBlockPointerType()) Diag(Loc, diag::warn_objc_property_retain_of_block); + + if ((Attributes & ObjCDeclSpec::DQ_PR_readonly) && + (Attributes & ObjCDeclSpec::DQ_PR_setter)) + Diag(Loc, diag::warn_objc_readonly_property_has_setter); + } |