Break loop early

This commit is contained in:
Dmitry-Me 2017-08-26 07:26:28 +03:00
parent 46c6620691
commit b9c2a996bf
1 changed files with 6 additions and 2 deletions

View File

@ -2638,8 +2638,12 @@ void Tokenizer::setVarIdPass1()
scopeStack.push(VarIdScopeInfo(isExecutable, scopeStack.top().isStructInit || tok->strAt(-1) == "=", isEnumStart(tok), _varId)); scopeStack.push(VarIdScopeInfo(isExecutable, scopeStack.top().isStructInit || tok->strAt(-1) == "=", isEnumStart(tok), _varId));
} else { /* if (tok->str() == "}") */ } else { /* if (tok->str() == "}") */
bool isNamespace = false; bool isNamespace = false;
for (const Token *tok1 = tok->link()->previous(); tok1 && tok1->isName(); tok1 = tok1->previous()) for (const Token *tok1 = tok->link()->previous(); tok1 && tok1->isName(); tok1 = tok1->previous()) {
isNamespace |= (tok1->str() == "namespace"); if (tok1->str() == "namespace") {
isNamespace = true;
break;
}
}
// Set variable ids in class declaration.. // Set variable ids in class declaration..
if (!initlist && !isC() && !scopeStack.top().isExecutable && tok->link() && !isNamespace) { if (!initlist && !isC() && !scopeStack.top().isExecutable && tok->link() && !isNamespace) {
setVarIdClassDeclaration(tok->link(), setVarIdClassDeclaration(tok->link(),