diff options
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 4720bcb572..62bd9ae73c 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -919,6 +919,16 @@ Parser::ParsePostfixExpressionSuffix(OwningExprResult LHS) { tok::TokenKind OpKind = Tok.getKind(); SourceLocation OpLoc = ConsumeToken(); // Eat the "." or "->" token. + CXXScopeSpec MemberSS; + CXXScopeSpec SS; + if (getLang().CPlusPlus && !LHS.isInvalid()) { + LHS = Actions.ActOnCXXEnterMemberScope(CurScope, MemberSS, move(LHS), + OpKind); + if (LHS.isInvalid()) + break; + ParseOptionalCXXScopeSpecifier(SS); + } + if (Tok.isNot(tok::identifier)) { Diag(Tok, diag::err_expected_ident); return ExprError(); @@ -928,8 +938,12 @@ Parser::ParsePostfixExpressionSuffix(OwningExprResult LHS) { LHS = Actions.ActOnMemberReferenceExpr(CurScope, move(LHS), OpLoc, OpKind, Tok.getLocation(), *Tok.getIdentifierInfo(), - ObjCImpDecl); + ObjCImpDecl, &SS); } + + if (getLang().CPlusPlus) + Actions.ActOnCXXExitMemberScope(CurScope, MemberSS); + ConsumeToken(); break; } |