Fixed #6992 (argument name of function typedef conflicts with local variable name)
This commit is contained in:
parent
141dd78b0e
commit
97326fce13
|
@ -5189,9 +5189,11 @@ void Tokenizer::simplifyFunctionPointers()
|
||||||
continue;
|
continue;
|
||||||
while (Token::Match(tok2, "(|:: %type%"))
|
while (Token::Match(tok2, "(|:: %type%"))
|
||||||
tok2 = tok2->tokAt(2);
|
tok2 = tok2->tokAt(2);
|
||||||
if (!Token::Match(tok2, "(|:: * %name%"))
|
if (!Token::Match(tok2, "(|:: * *| %name%"))
|
||||||
continue;
|
continue;
|
||||||
tok2 = tok2->tokAt(2);
|
tok2 = tok2->tokAt(2);
|
||||||
|
if (tok2->str() == "*")
|
||||||
|
tok2 = tok2->next();
|
||||||
while (Token::Match(tok2, "%type%|:: %type%|::"))
|
while (Token::Match(tok2, "%type%|:: %type%|::"))
|
||||||
tok2 = tok2->next();
|
tok2 = tok2->next();
|
||||||
|
|
||||||
|
|
|
@ -1000,7 +1000,7 @@ private:
|
||||||
"class X { } ; "
|
"class X { } ; "
|
||||||
"int main ( ) "
|
"int main ( ) "
|
||||||
"{ "
|
"{ "
|
||||||
"X ( * * Foo ) ( const X & ) ; Foo = new X ( * ) ( const X & ) [ 2 ] ; "
|
"X * * Foo ; Foo = new X ( * ) ( const X & ) [ 2 ] ; "
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
ASSERT_EQUALS(expected, tok(code, false));
|
ASSERT_EQUALS(expected, tok(code, false));
|
||||||
|
@ -2990,8 +2990,8 @@ private:
|
||||||
"{ "
|
"{ "
|
||||||
"int Format_T2 ; "
|
"int Format_T2 ; "
|
||||||
"} "
|
"} "
|
||||||
"int ( * * t1 ) ( ) ; "
|
"int * * t1 ; "
|
||||||
"int ( * * t2 ) ( ) ;",
|
"int * * t2 ;",
|
||||||
tok(code,false));
|
tok(code,false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue