Skip to content

Commit

Permalink
Add valueType-originalTypeName
Browse files Browse the repository at this point in the history
  • Loading branch information
swasti16 committed Aug 12, 2024
1 parent c8cdd7a commit b3f92e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,8 @@ namespace {
const bool isFunctionPointer = Token::Match(mNameToken, "%name% )");
if (isFunctionPointer && isCast(tok->previous())) {
tok->insertToken("*");
insertTokens(tok, std::pair<Token*, Token*>(mRangeType.first, mNameToken->linkAt(1)));
Token* const tok_1 = insertTokens(tok, std::pair<Token*, Token*>(mRangeType.first, mNameToken->linkAt(1)));
tok_1->originalName(tok->str());
tok->deleteThis();
return;
}
Expand Down Expand Up @@ -1041,7 +1042,7 @@ namespace {

private:
static bool isCast(const Token* tok) {
if (Token::Match(tok, "( %name% ) (|%name%"))
if (Token::Match(tok, "( %name% ) (|%name%|%number%"))
return !tok->tokAt(2)->isKeyword();
if (Token::Match(tok, "< %name% > (") && tok->previous() && endsWith(tok->strAt(-1), "_cast", 5))
return true;
Expand Down

0 comments on commit b3f92e6

Please sign in to comment.