aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-15 04:42:30 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-15 04:42:30 +0000
commit5e3c67b4bd894a926282d24b4d0cbc0e123c9f4a (patch)
treeb1bfcfbc4d91153c5f4d76ee4af95dde3b8b258d /lib/Sema/SemaExpr.cpp
parentbfdcdc8e26097c9dbb4c40d78296f6ccc3e6684c (diff)
Sundry missing lvalue-to-rvalue conversions. Also leave a TODO for the vital
future task of performing contextual conversion to size_t in a VLA size expression. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index baa7bf8670..ea4f6bc855 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -3450,6 +3450,7 @@ Sema::LookupMemberExpr(LookupResult &R, Expr *&BaseExpr,
// Perform default conversions.
DefaultFunctionArrayConversion(BaseExpr);
+ if (IsArrow) DefaultLvalueConversion(BaseExpr);
QualType BaseType = BaseExpr->getType();
assert(!BaseType->isDependentType());
@@ -3795,8 +3796,9 @@ Sema::LookupMemberExpr(LookupResult &R, Expr *&BaseExpr,
// 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())
@@ -3826,12 +3828,12 @@ Sema::LookupMemberExpr(LookupResult &R, Expr *&BaseExpr,
/// 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();