Check for same expression in condition check to avoid duplicate messages (#1359)
This commit is contained in:
parent
341dee4a07
commit
ab55b9eccb
|
@ -1214,6 +1214,8 @@ void CheckCondition::alwaysTrueFalse()
|
||||||
continue;
|
continue;
|
||||||
if (Token::Match(tok, "%oror%|&&"))
|
if (Token::Match(tok, "%oror%|&&"))
|
||||||
continue;
|
continue;
|
||||||
|
if (Token::Match(tok, "%comp%") && isSameExpression(mTokenizer->isCPP(), true, tok->astOperand1(), tok->astOperand2(), mSettings->library, true))
|
||||||
|
continue;
|
||||||
|
|
||||||
const bool constIfWhileExpression =
|
const bool constIfWhileExpression =
|
||||||
tok->astParent() && Token::Match(tok->astTop()->astOperand1(), "if|while") &&
|
tok->astParent() && Token::Match(tok->astTop()->astOperand1(), "if|while") &&
|
||||||
|
|
Loading…
Reference in New Issue