@@ -3386,75 +3386,15 @@ void UnwrappedLineParser::parseSwitch(bool IsExpr) {
33863386 NestedTooDeep.pop_back ();
33873387}
33883388
3389- // Operators that can follow a C variable.
3390- static bool isCOperatorFollowingVar (tok::TokenKind Kind) {
3391- switch (Kind) {
3392- case tok::ampamp:
3393- case tok::ampequal:
3394- case tok::arrow:
3395- case tok::caret:
3396- case tok::caretequal:
3397- case tok::comma:
3398- case tok::ellipsis:
3399- case tok::equal:
3400- case tok::equalequal:
3401- case tok::exclaim:
3402- case tok::exclaimequal:
3403- case tok::greater:
3404- case tok::greaterequal:
3405- case tok::greatergreater:
3406- case tok::greatergreaterequal:
3407- case tok::l_paren:
3408- case tok::l_square:
3409- case tok::less:
3410- case tok::lessequal:
3411- case tok::lessless:
3412- case tok::lesslessequal:
3413- case tok::minus:
3414- case tok::minusequal:
3415- case tok::minusminus:
3416- case tok::percent:
3417- case tok::percentequal:
3418- case tok::period:
3419- case tok::pipe:
3420- case tok::pipeequal:
3421- case tok::pipepipe:
3422- case tok::plus:
3423- case tok::plusequal:
3424- case tok::plusplus:
3425- case tok::question:
3426- case tok::r_brace:
3427- case tok::r_paren:
3428- case tok::r_square:
3429- case tok::semi:
3430- case tok::slash:
3431- case tok::slashequal:
3432- case tok::star:
3433- case tok::starequal:
3434- return true ;
3435- default :
3436- return false ;
3437- }
3438- }
3439-
34403389void UnwrappedLineParser::parseAccessSpecifier () {
3441- FormatToken *AccessSpecifierCandidate = FormatTok;
34423390 nextToken ();
34433391 // Understand Qt's slots.
34443392 if (FormatTok->isOneOf (Keywords.kw_slots , Keywords.kw_qslots ))
34453393 nextToken ();
34463394 // Otherwise, we don't know what it is, and we'd better keep the next token.
3447- if (FormatTok->is (tok::colon)) {
3395+ if (FormatTok->is (tok::colon))
34483396 nextToken ();
3449- addUnwrappedLine ();
3450- } else if (FormatTok->isNot (tok::coloncolon) &&
3451- !isCOperatorFollowingVar (FormatTok->Tok .getKind ())) {
3452- // Not a variable name nor namespace name.
3453- addUnwrappedLine ();
3454- } else if (AccessSpecifierCandidate) {
3455- // Consider the access specifier to be a C identifier.
3456- AccessSpecifierCandidate->Tok .setKind (tok::identifier);
3457- }
3397+ addUnwrappedLine ();
34583398}
34593399
34603400// / \brief Parses a requires, decides if it is a clause or an expression.
0 commit comments