Skip to content

Commit

Permalink
fix #13640
Browse files Browse the repository at this point in the history
  • Loading branch information
ludviggunne committed Feb 16, 2025
1 parent 0d3866b commit 8df7e6c
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions lib/tokenlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1582,19 +1582,17 @@ static Token * createAstAtToken(Token *tok)
return tok2;
}
if (Token *const endTok = skipMethodDeclEnding(tok)) {
if (Token::simpleMatch(endTok, "{")) {
Token *tok2 = tok;
do {
tok2 = tok2->next();
tok2->setCpp11init(false);
if (Token::Match(tok2, "decltype|noexcept (")) {
AST_state state(cpp);
Token *tok3 = tok2->tokAt(2);
compileExpression(tok3, state);
tok2 = tok2->linkAt(1);
}
} while (tok2 != endTok && !precedes(endTok, tok2));
}
Token *tok2 = tok;
do {
tok2 = tok2->next();
tok2->setCpp11init(false);
if (Token::Match(tok2, "decltype|noexcept (")) {
AST_state state(cpp);
Token *tok3 = tok2->tokAt(2);
compileExpression(tok3, state);
tok2 = tok2->linkAt(1);
}
} while (tok2 != endTok && !precedes(endTok, tok2));
return endTok;
}
if (Token::Match(tok, "%type%") && !Token::Match(tok, "return|throw|if|while|new|delete")) {
Expand Down

0 comments on commit 8df7e6c

Please sign in to comment.