diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-05 01:24:05 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-05 01:24:05 +0000 |
| commit | b5134c05b9cfe1d82f3aaa6a098012acca607678 (patch) | |
| tree | 6af29f6718d8a7520c882c819ee76478cdd494b6 /clang/lib/Parse/ParseExprCXX.cpp | |
| parent | d8cd7b6c3431a8dcbf13457730cf10a7ed4118a4 (diff) | |
| download | bcm5719-llvm-b5134c05b9cfe1d82f3aaa6a098012acca607678.tar.gz bcm5719-llvm-b5134c05b9cfe1d82f3aaa6a098012acca607678.zip | |
TryAnnotateTypeOrScopeToken and TryAnnotateCXXScopeToken can
only be called when they might be needed now, so make them assert
that their current token is :: or identifier.
llvm-svn: 61662
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
| -rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index f9514352ee7..a4b97e173be 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -35,7 +35,7 @@ using namespace clang; bool Parser::MaybeParseCXXScopeSpecifier(CXXScopeSpec &SS, const Token *GlobalQualifier) { assert(getLang().CPlusPlus && - "Call sites of this function should be guarded by checking for C++."); + "Call sites of this function should be guarded by checking for C++"); if (Tok.is(tok::annot_cxxscope)) { assert(GlobalQualifier == 0 && @@ -183,13 +183,13 @@ Parser::OwningExprResult Parser::ParseCXXIdExpression() { case tok::kw_operator: { SourceLocation OperatorLoc = Tok.getLocation(); - if (OverloadedOperatorKind Op = TryParseOperatorFunctionId()) { + if (OverloadedOperatorKind Op = TryParseOperatorFunctionId()) return Owned(Actions.ActOnCXXOperatorFunctionIdExpr( CurScope, OperatorLoc, Op, Tok.is(tok::l_paren), SS)); - } else if (TypeTy *Type = ParseConversionFunctionId()) { - return Owned(Actions.ActOnCXXConversionFunctionExpr( - CurScope, OperatorLoc, Type, Tok.is(tok::l_paren),SS)); - } + if (TypeTy *Type = ParseConversionFunctionId()) + return Owned(Actions.ActOnCXXConversionFunctionExpr(CurScope, OperatorLoc, + Type, + Tok.is(tok::l_paren), SS)); // We already complained about a bad conversion-function-id, // above. |

