Skip to content

Commit 376b61a

Browse files
Update tokenize.cpp
1 parent 030b120 commit 376b61a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: lib/tokenize.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ void Tokenizer::simplifyTypedefCpp()
20162016
const bool isPointerTypeCall = !inOperator && Token::Match(tok2, "%name% ( )") && !pointers.empty();
20172017

20182018
// start substituting at the typedef name by replacing it with the type
2019-
const Token * const location = tok2;
2019+
const Token* location = tok2;
20202020
for (Token* tok3 = typeStart; tok3 && (tok3->str() != ";"); tok3 = tok3->next())
20212021
tok3->isSimplifiedTypedef(true);
20222022
if (isPointerTypeCall) {
@@ -2081,6 +2081,7 @@ void Tokenizer::simplifyTypedefCpp()
20812081
if (constTok && !functionPtr) {
20822082
tok2 = simplifyTypedefInsertToken(tok2, "const", location);
20832083
constTok->deleteThis();
2084+
location = constTok;
20842085
}
20852086
}
20862087

0 commit comments

Comments
 (0)