diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 782f18b4d..9ede3825f 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -143,7 +143,7 @@ bool isSameExpression(const Token *tok1, const Token *tok2, const std::setastOperand1() && tok1->astOperand2() && Token::Match(tok1, "+|*|%or%|%oror%|&|&&|^|==|!="); + bool commutative = tok1->astOperand1() && tok1->astOperand2() && Token::Match(tok1, "%or%|%oror%|+|*|&|&&|^|==|!="); bool commuative_equals = commutative && isSameExpression(tok1->astOperand2(), tok2->astOperand1(), constFunctions); commuative_equals = commuative_equals &&