diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ac250b0fc..3a985df92 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7223,7 +7223,7 @@ bool Tokenizer::simplifyCalculations() // keep parentheses here: operator new [] (size_t); // keep parentheses here: Functor()(a ... ) // keep parentheses here: ) ( var ) ; - if (Token::Match(tok->next(), "( %var% ) [;),+-*/><]]") && + if (Token::Match(tok->next(), "( %var% ) ;|)|,|]|%op%") && !tok->isName() && tok->str() != ">" && tok->str() != "]" && diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 53cdf121f..329fa0276 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -381,7 +381,7 @@ private: void simplifyTokenList1() { // #1717 : The simplifyErrNoInWhile needs to be used before simplifyIfAssign.. - ASSERT_EQUALS("; x = f ( ) ; while ( ( x ) == -1 ) { x = f ( ) ; }", + ASSERT_EQUALS("; x = f ( ) ; while ( x == -1 ) { x = f ( ) ; }", tok(";while((x=f())==-1 && errno==EINTR){}",true)); }