// Perform default conversions.
DefaultFunctionArrayConversion(BaseExpr);
+ if (IsArrow) DefaultLvalueConversion(BaseExpr);
QualType BaseType = BaseExpr->getType();
assert(!BaseType->isDependentType());
// Handle 'field access' to vectors, such as 'V.xx'.
if (BaseType->isExtVectorType()) {
+ // FIXME: this expr should store IsArrow.
IdentifierInfo *Member = MemberName.getAsIdentifierInfo();
- ExprValueKind VK = BaseExpr->getValueKind();
+ ExprValueKind VK = (IsArrow ? VK_LValue : BaseExpr->getValueKind());
QualType ret = CheckExtVectorComponent(*this, BaseType, VK, OpLoc,
Member, MemberLoc);
if (ret.isNull())
/// this is an ugly hack around the fact that ObjC @implementations
/// aren't properly put in the context chain
ExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base,
- SourceLocation OpLoc,
- tok::TokenKind OpKind,
- CXXScopeSpec &SS,
- UnqualifiedId &Id,
- Decl *ObjCImpDecl,
- bool HasTrailingLParen) {
+ SourceLocation OpLoc,
+ tok::TokenKind OpKind,
+ CXXScopeSpec &SS,
+ UnqualifiedId &Id,
+ Decl *ObjCImpDecl,
+ bool HasTrailingLParen) {
if (SS.isSet() && SS.isInvalid())
return ExprError();
StmtResult Sema::BuildObjCAtThrowStmt(SourceLocation AtLoc,
Expr *Throw) {
if (Throw) {
+ DefaultLvalueConversion(Throw);
+
QualType ThrowType = Throw->getType();
// Make sure the expression type is an ObjC pointer or "void *".
if (!ThrowType->isDependentType() &&
Stmt *SyncBody) {
getCurFunction()->setHasBranchProtectedScope();
+ DefaultLvalueConversion(SyncExpr);
+
// Make sure the expression type is an ObjC pointer or "void *".
if (!SyncExpr->getType()->isDependentType() &&
!SyncExpr->getType()->isObjCObjectPointerType()) {
return QualType();
}
+ // Do lvalue-to-rvalue conversions on the array size expression.
+ if (ArraySize && !ArraySize->isRValue())
+ DefaultLvalueConversion(ArraySize);
+
// C99 6.7.5.2p1: The size expression shall have integer type.
+ // TODO: in theory, if we were insane, we could allow contextual
+ // conversions to integer type here.
if (ArraySize && !ArraySize->isTypeDependent() &&
!ArraySize->getType()->isIntegralOrUnscopedEnumerationType()) {
Diag(ArraySize->getLocStart(), diag::err_array_size_non_int)