diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-03 16:56:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-03 16:56:39 +0000 |
commit | a121b75d9d97daf01fd57834059a6529ca7696fc (patch) | |
tree | d4d7713a7c27f161225d743b77f1d0f7c336c81b /clang/lib/Parse/ParseExprCXX.cpp | |
parent | e1d5cd9f4862c2a568dc7c6cc7ede308484fac92 (diff) | |
download | bcm5719-llvm-a121b75d9d97daf01fd57834059a6529ca7696fc.tar.gz bcm5719-llvm-a121b75d9d97daf01fd57834059a6529ca7696fc.zip |
Use ParseUnqualifiedId when parsing id-expressions. This eliminates
yet another copy of the unqualified-id parsing code.
Also, use UnqualifiedId to simplify the Action interface for building
id-expressions. ActOnIdentifierExpr, ActOnCXXOperatorFunctionIdExpr,
ActOnCXXConversionFunctionExpr, and ActOnTemplateIdExpr have all been
removed in favor of the new ActOnIdExpression action.
llvm-svn: 85904
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index dc7974135d3..b1250350f70 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -309,7 +309,19 @@ Parser::OwningExprResult Parser::ParseCXXIdExpression(bool isAddressOfOperand) { // CXXScopeSpec SS; ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/0, false); - + + UnqualifiedId Name; + if (ParseUnqualifiedId(SS, + /*EnteringContext=*/false, + /*AllowDestructorName=*/false, + /*AllowConstructorName=*/false, + Name)) + return ExprError(); + + return Actions.ActOnIdExpression(CurScope, SS, Name, Tok.is(tok::l_paren), + isAddressOfOperand); + +#if 0 // unqualified-id: // identifier // operator-function-id @@ -372,6 +384,7 @@ Parser::OwningExprResult Parser::ParseCXXIdExpression(bool isAddressOfOperand) { } // switch. assert(0 && "The switch was supposed to take care everything."); +#endif } /// ParseCXXCasts - This handles the various ways to cast expressions to another |