From b5134c05b9cfe1d82f3aaa6a098012acca607678 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 5 Jan 2009 01:24:05 +0000 Subject: 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 --- clang/lib/Parse/ParseExprCXX.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'clang/lib/Parse/ParseExprCXX.cpp') 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. -- cgit v1.2.3