diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-03-30 13:33:51 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-03-30 13:33:51 +0000 |
commit | 535571a2a1538d4ccb6285810f32ff3755e3cf85 (patch) | |
tree | c3d18482f9fb5d9281bc4ce5e9d99eb6a36de717 /clang/lib/Sema/SemaObjCProperty.cpp | |
parent | 41ca83f8114013894b5f4b97be597f2f0e7ae02d (diff) | |
download | bcm5719-llvm-535571a2a1538d4ccb6285810f32ff3755e3cf85.tar.gz bcm5719-llvm-535571a2a1538d4ccb6285810f32ff3755e3cf85.zip |
[Sema][ObjC] Avoid the "type of property does not match type of accessor"
warning for methods that resemble the setters of readonly properties
rdar://30415679
llvm-svn: 299078
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index b9506152104..6c571645487 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -2185,12 +2185,9 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property) { DiagnosePropertyAccessorMismatch(property, GetterMethod, property->getLocation()); - if (SetterMethod) { - ObjCPropertyDecl::PropertyAttributeKind CAttr = - property->getPropertyAttributes(); - if ((!(CAttr & ObjCPropertyDecl::OBJC_PR_readonly)) && - Context.getCanonicalType(SetterMethod->getReturnType()) != - Context.VoidTy) + if (!property->isReadOnly() && SetterMethod) { + if (Context.getCanonicalType(SetterMethod->getReturnType()) != + Context.VoidTy) Diag(SetterMethod->getLocation(), diag::err_setter_type_void); if (SetterMethod->param_size() != 1 || !Context.hasSameUnqualifiedType( |