forked from OSchip/llvm-project
Do not diagnose method disguised as property setter
for a 'readonly' property. Fixes radar 7427072. llvm-svn: 92808
This commit is contained in:
parent
578865ff3d
commit
1a5f292fbf
|
@ -1473,8 +1473,11 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property,
|
||||||
property->getLocation());
|
property->getLocation());
|
||||||
|
|
||||||
if (SetterMethod) {
|
if (SetterMethod) {
|
||||||
if (Context.getCanonicalType(SetterMethod->getResultType())
|
ObjCPropertyDecl::PropertyAttributeKind CAttr =
|
||||||
!= Context.VoidTy)
|
property->getPropertyAttributes();
|
||||||
|
if ((!(CAttr & ObjCPropertyDecl::OBJC_PR_readonly)) &&
|
||||||
|
Context.getCanonicalType(SetterMethod->getResultType()) !=
|
||||||
|
Context.VoidTy)
|
||||||
Diag(SetterMethod->getLocation(), diag::err_setter_type_void);
|
Diag(SetterMethod->getLocation(), diag::err_setter_type_void);
|
||||||
if (SetterMethod->param_size() != 1 ||
|
if (SetterMethod->param_size() != 1 ||
|
||||||
((*SetterMethod->param_begin())->getType() != property->getType())) {
|
((*SetterMethod->param_begin())->getType() != property->getType())) {
|
||||||
|
|
|
@ -84,3 +84,15 @@ typedef signed char BOOL;
|
||||||
view.inEyeDropperMode = 1;
|
view.inEyeDropperMode = 1;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
// radar 7427072
|
||||||
|
@interface MyStyleIntf
|
||||||
|
{
|
||||||
|
int _myStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property(readonly) int myStyle;
|
||||||
|
|
||||||
|
- (float)setMyStyle:(int)style;
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue