Tokenizer: Don't simplify '({..})' wrongly
This commit is contained in:
parent
5d7fa590af
commit
8c707876ed
|
@ -6868,6 +6868,9 @@ bool Tokenizer::simplifyRedundantParentheses()
|
|||
if (tok->str() != "(")
|
||||
continue;
|
||||
|
||||
if (Token::simpleMatch(tok, "( {"))
|
||||
continue;
|
||||
|
||||
if (Token::Match(tok->link(), ") %num%")) {
|
||||
tok = tok->link();
|
||||
continue;
|
||||
|
|
|
@ -1007,8 +1007,8 @@ private:
|
|||
"}\n";
|
||||
const char expected1[] = "1: void f ( ) {\n"
|
||||
"2: for ( int i@1 ;\n"
|
||||
"3: { for ( int i@2 ; i@2 ; ++ i@2 ) { i@2 ++ ; } i@1 ++ ; } , i@1 ;\n"
|
||||
"4: { for ( int i@3 ; i@3 ; ++ i@3 ) { i@3 ++ ; } i@1 ++ ; } , i@1 ++ ) {\n"
|
||||
"3: ( { for ( int i@2 ; i@2 ; ++ i@2 ) { i@2 ++ ; } i@1 ++ ; } ) , i@1 ;\n"
|
||||
"4: ( { for ( int i@3 ; i@3 ; ++ i@3 ) { i@3 ++ ; } i@1 ++ ; } ) , i@1 ++ ) {\n"
|
||||
"5: i@1 ++ ;\n"
|
||||
"6: }\n"
|
||||
"7: }\n";
|
||||
|
|
Loading…
Reference in New Issue