File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1087,7 +1087,7 @@ bool TemplateSimplifier::simplifyCalculations(Token *_tokens)
10871087 }
10881088
10891089 // Remove parentheses around number..
1090- if (Token::Match (tok->tokAt (-2 ), " %any% ( %num% )" ) && !tok->tokAt (-2 )->isName () && tok->strAt (-2 ) != " >" ) {
1090+ if (Token::Match (tok->tokAt (-2 ), " %op%|< ( %num% )" ) && !tok->tokAt (-2 )->isName () && tok->strAt (-2 ) != " >" ) {
10911091 tok = tok->previous ();
10921092 tok->deleteThis ();
10931093 tok->deleteNext ();
Original file line number Diff line number Diff line change @@ -2059,6 +2059,9 @@ class TestSimplifyTokens : public TestFixture {
20592059 ASSERT_EQUALS (" ( y % 2 - 2 )" , tok (" (y % 2 - 2)" ));
20602060
20612061 ASSERT_EQUALS (" ( 4 )" , tok (" (1 * 2 / 1 * 2)" )); // #3722
2062+
2063+ // don't remove these spaces..
2064+ ASSERT_EQUALS (" new ( auto ) ( 4 ) ;" , tok (" new (auto)(4);" ));
20622065 }
20632066
20642067 void comparisons () {
You can’t perform that action at this time.
0 commit comments