diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-06 03:17:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-06 03:17:00 +0000 |
commit | fe85cedd58df7daed29201703cfb8806e12876d0 (patch) | |
tree | 3839a33ad270a9f4ed978e24e87a93d3ad409fdd /lib/Parse/ParseExpr.cpp | |
parent | 4403a5e1f956fa86d515492dbe7c7a2817d8780d (diff) |
Support nested-name-specifiers for C++ member access expressions, e.g.,
this->Base::foo
from James Porter!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78278 91177308-0d34-0410-b5e6-96231b3b80d8
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; } |