From 5e9e90b1c109efd8e20516a3c13450ada7f320e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 1 Jul 2014 15:55:29 +0200 Subject: [PATCH] Fixed Token::Match pattern. In x|y|.. patterns, all %cmd% should be placed before plain-text operands. --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 &&