Fixed Token::Match pattern. In x|y|.. patterns, all %cmd% should be placed before plain-text operands.
This commit is contained in:
parent
b7d7633b97
commit
5e9e90b1c1
|
@ -143,7 +143,7 @@ bool isSameExpression(const Token *tok1, const Token *tok2, const std::set<std::
|
||||||
if (noncommuative_equals)
|
if (noncommuative_equals)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
bool commutative = tok1->astOperand1() && tok1->astOperand2() && Token::Match(tok1, "+|*|%or%|%oror%|&|&&|^|==|!=");
|
bool commutative = tok1->astOperand1() && tok1->astOperand2() && Token::Match(tok1, "%or%|%oror%|+|*|&|&&|^|==|!=");
|
||||||
bool commuative_equals = commutative &&
|
bool commuative_equals = commutative &&
|
||||||
isSameExpression(tok1->astOperand2(), tok2->astOperand1(), constFunctions);
|
isSameExpression(tok1->astOperand2(), tok2->astOperand1(), constFunctions);
|
||||||
commuative_equals = commuative_equals &&
|
commuative_equals = commuative_equals &&
|
||||||
|
|
Loading…
Reference in New Issue