Skip to content

Commit

Permalink
Update tokenize.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed May 15, 2024
1 parent b5cb0f8 commit 1a16c4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4617,8 +4617,9 @@ void Tokenizer::setVarIdPass1()
if (!(scopeStack.top().isStructInit || tok->strAt(-1) == "="))
variableMap.enterScope();
}
const bool isStructInit = scopeStack.top().isStructInit || tok->strAt(-1) == "=" || (initlist && !Token::Match(tok->tokAt(-1), "[)}]"));
scopeStack.emplace(isExecutable, isStructInit, isEnumStart(tok), variableMap.getVarId());
initlist = false;
scopeStack.emplace(isExecutable, scopeStack.top().isStructInit || tok->strAt(-1) == "=", isEnumStart(tok), variableMap.getVarId());
} else { /* if (tok->str() == "}") */
bool isNamespace = false;
for (const Token *tok1 = tok->link()->previous(); tok1 && tok1->isName(); tok1 = tok1->previous()) {
Expand Down

0 comments on commit 1a16c4e

Please sign in to comment.