зеркало из https://github.com/microsoft/clang-1.git
Do not diagnose method disguised as property setter
for a 'readonly' property. Fixes radar 7427072. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92808 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
cd7a445c6b
Коммит
02deae8f9b
|
@ -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())) {
|
||||
|
|
|
@ -84,3 +84,15 @@ typedef signed char BOOL;
|
|||
view.inEyeDropperMode = 1;
|
||||
}
|
||||
@end
|
||||
|
||||
// radar 7427072
|
||||
@interface MyStyleIntf
|
||||
{
|
||||
int _myStyle;
|
||||
}
|
||||
|
||||
@property(readonly) int myStyle;
|
||||
|
||||
- (float)setMyStyle:(int)style;
|
||||
@end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче