diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 59a11e0aa5c..ffbfbeb6533 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7910,15 +7910,6 @@ bool Tokenizer::simplifyRedundantParentheses() continue; } - while (Token::simpleMatch(tok, "( (") && - tok->link() && tok->link()->previous() == tok->linkAt(1)) { - // We have "(( *something* ))", remove the inner - // parentheses - tok->deleteNext(); - tok->link()->tokAt(-2)->deleteNext(); - ret = true; - } - if (isCPP() && Token::Match(tok->tokAt(-2), "[;{}=(] new (") && Token::Match(tok->link(), ") [;,{}[]")) { // Remove the parentheses in "new (type)" constructs tok->link()->deleteThis(); @@ -7989,7 +7980,7 @@ bool Tokenizer::simplifyRedundantParentheses() } while (Token::Match(tok->previous(), "[{([,] ( !!{") && - Token::Match(tok->link(), ") [;,])]") && + Token::Match(tok->link(), ") [;,])] !!{") && !Token::simpleMatch(tok->tokAt(-2), "operator ,") && // Ticket #5709 !Token::findsimplematch(tok, ",", tok->link())) { // We have "( ... )", remove the parentheses diff --git a/test/testsimplifytypedef.cpp b/test/testsimplifytypedef.cpp index 8a79f93a94a..df8d74133b6 100644 --- a/test/testsimplifytypedef.cpp +++ b/test/testsimplifytypedef.cpp @@ -1150,7 +1150,7 @@ class TestSimplifyTypedef : public TestFixture { "int main ( ) " "{ " "" - "VERIFY ( is_same < result_of < int ( * ( char , float ) ) ( float , double ) > :: type , int > :: value ) ; " + "VERIFY ( ( is_same < result_of < int ( * ( char , float ) ) ( float , double ) > :: type , int > :: value ) ) ; " "}"; ASSERT_EQUALS(expected, tok(code, false));