Change location of %op% operator in multicompare

When the %op% operator is the first element
of a multicompare, it properly executes Token::isOp().
Otherwise it uses it's "internal implementation".

Workaround inspired by Edoardo Prezioso.
This commit is contained in:
Thomas Jarosch 2013-01-08 20:26:48 +01:00
parent 9ecc74e845
commit 8b2adf1391
1 changed files with 1 additions and 1 deletions

View File

@ -793,7 +793,7 @@ bool TemplateSimplifier::simplifyCalculations(Token *_tokens)
// keep parentheses here: operator new [] (size_t);
// keep parentheses here: Functor()(a ... )
// keep parentheses here: ) ( var ) ;
if (Token::Match(tok->next(), "( %var% ) ;|)|,|]|%op%") &&
if (Token::Match(tok->next(), "( %var% ) %op%|;|)|,|]") &&
!tok->isName() &&
tok->str() != ">" &&
tok->str() != "]" &&