Skip to content

Commit

Permalink
Update tokenlist.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Apr 3, 2024
1 parent de03c8b commit 0f8d2d5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/tokenlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,8 @@ static Token * createAstAtToken(Token *tok)
AST_state state(cpp);
if (Token::Match(tok, "%name% ("))
state.functionCallEndPar = tok->linkAt(1);
if (Token::simpleMatch(tok->tokAt(-1), "::") && (!tok->tokAt(-2) || !tok->tokAt(-2)->isName()))
tok = tok->tokAt(-1);
compileExpression(tok, state);
Token * const endToken = tok;
if (endToken == tok1 || !endToken)
Expand All @@ -1760,11 +1762,6 @@ static Token * createAstAtToken(Token *tok)
return endToken->previous();
}

if (cpp && ((!tok->previous() && tok->str() == "::") || Token::Match(tok->previous(), "[;{}] ::"))) {
AST_state state(cpp);
compileUnaryOp(tok, state, nullptr);
}

return tok;
}

Expand Down

0 comments on commit 0f8d2d5

Please sign in to comment.