Fixed Cppcheck warning, condition is always false

This commit is contained in:
Daniel Marjamäki 2019-06-30 18:43:55 +02:00
parent 56df6169fb
commit 4d81b77249
1 changed files with 1 additions and 4 deletions

View File

@ -1868,7 +1868,6 @@ bool Tokenizer::simplifyUsing()
std::list<ScopeInfo3> scopeList; std::list<ScopeInfo3> scopeList;
bool inTemplateDefinition = false; bool inTemplateDefinition = false;
const Token *endOfTemplateDefinition = nullptr; const Token *endOfTemplateDefinition = nullptr;
bool isVariable = false;
struct Using { struct Using {
Using(Token *start, Token *end) : startTok(start), endTok(end) { } Using(Token *start, Token *end) : startTok(start), endTok(end) { }
Token *startTok; Token *startTok;
@ -1892,9 +1891,7 @@ bool Tokenizer::simplifyUsing()
if (inTemplateDefinition) { if (inTemplateDefinition) {
if (!endOfTemplateDefinition) { if (!endOfTemplateDefinition) {
if (isVariable) if (tok->str() == "{")
endOfTemplateDefinition = findSemicolon(tok);
else if (tok->str() == "{")
endOfTemplateDefinition = tok->link(); endOfTemplateDefinition = tok->link();
} }
if (tok == endOfTemplateDefinition) { if (tok == endOfTemplateDefinition) {