Fixed Token::Match pattern. In x|y|.. patterns, all %cmd% should be placed before plain-text operands.

This commit is contained in:
Daniel Marjamäki 2014-07-01 15:55:29 +02:00
parent b7d7633b97
commit 5e9e90b1c1
1 changed files with 1 additions and 1 deletions

View File

@ -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 &&