From b3f92e61cd9cc720c0344d191370afa4005297b0 Mon Sep 17 00:00:00 2001 From: swasti16 Date: Mon, 12 Aug 2024 16:03:58 +0530 Subject: [PATCH] Add valueType-originalTypeName --- lib/tokenize.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index d9f1131f5197..e4bd55c705d8 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -781,7 +781,8 @@ namespace { const bool isFunctionPointer = Token::Match(mNameToken, "%name% )"); if (isFunctionPointer && isCast(tok->previous())) { tok->insertToken("*"); - insertTokens(tok, std::pair(mRangeType.first, mNameToken->linkAt(1))); + Token* const tok_1 = insertTokens(tok, std::pair(mRangeType.first, mNameToken->linkAt(1))); + tok_1->originalName(tok->str()); tok->deleteThis(); return; } @@ -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;