diff options
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
| -rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index cabc7b5266d..3f335747a4a 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -100,48 +100,6 @@ void Parser::CheckForTemplateAndDigraph(Token &Next, ParsedType ObjectType, /*AtDigraph*/false); } -/// \brief Emits an error for a left parentheses after a double colon. -/// -/// When a '(' is found after a '::', emit an error. Attempt to fix the token -/// stream by removing the '(', and the matching ')' if found. -void Parser::CheckForLParenAfterColonColon() { - if (!Tok.is(tok::l_paren)) - return; - - Token LParen = Tok; - Token NextTok = GetLookAheadToken(1); - Token StarTok = NextTok; - // Check for (identifier or (*identifier - Token IdentifierTok = StarTok.is(tok::star) ? GetLookAheadToken(2) : StarTok; - if (IdentifierTok.isNot(tok::identifier)) - return; - // Eat the '('. - ConsumeParen(); - Token RParen; - RParen.setLocation(SourceLocation()); - // Do we have a ')' ? - NextTok = StarTok.is(tok::star) ? GetLookAheadToken(2) : GetLookAheadToken(1); - if (NextTok.is(tok::r_paren)) { - RParen = NextTok; - // Eat the '*' if it is present. - if (StarTok.is(tok::star)) - ConsumeToken(); - // Eat the identifier. - ConsumeToken(); - // Add the identifier token back. - PP.EnterToken(IdentifierTok); - // Add the '*' back if it was present. - if (StarTok.is(tok::star)) - PP.EnterToken(StarTok); - // Eat the ')'. - ConsumeParen(); - } - - Diag(LParen.getLocation(), diag::err_paren_after_colon_colon) - << FixItHint::CreateRemoval(LParen.getLocation()) - << FixItHint::CreateRemoval(RParen.getLocation()); -} - /// \brief Parse global scope or nested-name-specifier if present. /// /// Parses a C++ global scope specifier ('::') or nested-name-specifier (which @@ -237,8 +195,6 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, if (Actions.ActOnCXXGlobalScopeSpecifier(ConsumeToken(), SS)) return true; - CheckForLParenAfterColonColon(); - HasScopeSpecifier = true; } } @@ -491,8 +447,6 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS, Token ColonColon = Tok; SourceLocation CCLoc = ConsumeToken(); - CheckForLParenAfterColonColon(); - bool IsCorrectedToColon = false; bool *CorrectionFlagPtr = ColonIsSacred ? &IsCorrectedToColon : nullptr; if (Actions.ActOnCXXNestedNameSpecifier(getCurScope(), IdInfo, |

