diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-03 19:44:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-03 19:44:04 +0000 |
commit | 2d1c21414199a7452f122598189363a3922605b1 (patch) | |
tree | 927e5c12e6a452e070293b13047f49a08db4a140 /lib/Parse/ParseExpr.cpp | |
parent | 6c94a6d77f456f23ecd4c2061e6413786b5e6571 (diff) |
Replace the code that parses member access expressions after "." or
"->" with a use of ParseUnqualifiedId. Collapse
ActOnMemberReferenceExpr, ActOnDestructorReferenceExpr (both of them),
ActOnOverloadedOperatorReferenceExpr,
ActOnConversionOperatorReferenceExpr, and
ActOnMemberTemplateIdReferenceExpr into a single, new action
ActOnMemberAccessExpr that does the same thing more cleanly (and can
keep more source-location information).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 12025c66eb..b2cd3a777c 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -968,6 +968,21 @@ Parser::ParsePostfixExpressionSuffix(OwningExprResult LHS) { ConsumeToken(); } + UnqualifiedId Name; + if (ParseUnqualifiedId(SS, + /*EnteringContext=*/false, + /*AllowDestructorName=*/true, + /*AllowConstructorName=*/false, + ObjectType, + Name)) + return ExprError(); + + if (!LHS.isInvalid()) + LHS = Actions.ActOnMemberAccessExpr(CurScope, move(LHS), OpLoc, OpKind, + SS, Name, ObjCImpDecl, + Tok.is(tok::l_paren)); + +#if 0 if (Tok.is(tok::identifier)) { if (!LHS.isInvalid()) LHS = Actions.ActOnMemberReferenceExpr(CurScope, move(LHS), OpLoc, @@ -1072,6 +1087,7 @@ Parser::ParsePostfixExpressionSuffix(OwningExprResult LHS) { Diag(Tok, diag::err_expected_ident); return ExprError(); } +#endif break; } case tok::plusplus: // postfix-expression: postfix-expression '++' |