LV_DuplicateVectorComponents,
LV_InvalidExpression,
LV_MemberFunction,
- LV_SubObjCPropertySetting
+ LV_SubObjCPropertySetting,
+ LV_SubObjCPropertyGetterSetting
};
isLvalueResult isLvalue(ASTContext &Ctx) const;
MLV_ReadonlyProperty,
MLV_NoSetterProperty,
MLV_MemberFunction,
- MLV_SubObjCPropertySetting
+ MLV_SubObjCPropertySetting,
+ MLV_SubObjCPropertyGetterSetting
};
isModifiableLvalueResult isModifiableLvalue(ASTContext &Ctx,
SourceLocation *Loc = 0) const;
def error_nosetter_property_assignment : Error<
"setter method is needed to assign to object using property" " assignment syntax">;
def error_no_subobject_property_setting : Error<
- "cannot assign to a sub-structure of an ivar using property" " assignment syntax">;
+ "cannot assign to a sub-structure of an ivar using property"
+ " assignment syntax">;
+def error_no_subobject_property_getter_setting : Error<
+ "cannot assign to a sub-structure returned via a getter using property"
+ " assignment syntax">;
def ext_freestanding_complex : Extension<
"complex numbers are an extension in a freestanding C99 implementation">;
if (m->isArrow())
return LV_Valid;
Expr *BaseExp = m->getBase();
- return (BaseExp->getStmtClass() == ObjCPropertyRefExprClass) ?
- LV_SubObjCPropertySetting : BaseExp->isLvalue(Ctx);
+ if (BaseExp->getStmtClass() == ObjCPropertyRefExprClass)
+ return LV_SubObjCPropertySetting;
+ return
+ (BaseExp->getStmtClass() == ObjCImplicitSetterGetterRefExprClass) ?
+ LV_SubObjCPropertyGetterSetting : BaseExp->isLvalue(Ctx);
}
// -- If it refers to a static member function [...], then
if (m->isArrow())
return LV_Valid;
Expr *BaseExp = m->getBase();
- return (BaseExp->getStmtClass() == ObjCPropertyRefExprClass) ?
- LV_SubObjCPropertySetting : BaseExp->isLvalue(Ctx);
+ if (BaseExp->getStmtClass() == ObjCPropertyRefExprClass)
+ return LV_SubObjCPropertySetting;
+ return
+ (BaseExp->getStmtClass() == ObjCImplicitSetterGetterRefExprClass) ?
+ LV_SubObjCPropertyGetterSetting : BaseExp->isLvalue(Ctx);
}
case UnaryOperatorClass:
if (cast<UnaryOperator>(this)->getOpcode() == UnaryOperator::Deref)
}
return MLV_InvalidExpression;
case LV_MemberFunction: return MLV_MemberFunction;
- case LV_SubObjCPropertySetting: return MLV_SubObjCPropertySetting;
+ case LV_SubObjCPropertySetting: return MLV_SubObjCPropertySetting;
+ case LV_SubObjCPropertyGetterSetting:
+ return MLV_SubObjCPropertyGetterSetting;
}
// The following is illegal:
case Expr::MLV_SubObjCPropertySetting:
Diag = diag::error_no_subobject_property_setting;
break;
+ case Expr::MLV_SubObjCPropertyGetterSetting:
+ Diag = diag::error_no_subobject_property_getter_setting;
+ break;
}
SourceRange Assign;
f.size.width = 2.2; // expected-error {{cannot assign to a sub-structure of an ivar using property assignment syntax}}
f.size.inner.dim = 200; // expected-error {{cannot assign to a sub-structure of an ivar using property assignment syntax}}
}
+
+// radar 7628953
+
+@interface Gorf {
+}
+- (NSSize)size;
+@end
+
+@implementation Gorf
+- (void)MyView_sharedInit {
+ self.size.width = 2.2; // expected-error {{cannot assign to a sub-structure returned via a getter using property assignment syntax}}
+}
+- (NSSize)size {}
+@end