Fixed #6992 (argument name of function typedef conflicts with local variable name)

This commit is contained in:
Daniel Marjamäki 2015-10-12 10:15:02 +02:00
parent 141dd78b0e
commit 97326fce13
2 changed files with 6 additions and 4 deletions

View File

@ -5189,9 +5189,11 @@ void Tokenizer::simplifyFunctionPointers()
continue;
while (Token::Match(tok2, "(|:: %type%"))
tok2 = tok2->tokAt(2);
if (!Token::Match(tok2, "(|:: * %name%"))
if (!Token::Match(tok2, "(|:: * *| %name%"))
continue;
tok2 = tok2->tokAt(2);
if (tok2->str() == "*")
tok2 = tok2->next();
while (Token::Match(tok2, "%type%|:: %type%|::"))
tok2 = tok2->next();

View File

@ -1000,7 +1000,7 @@ private:
"class X { } ; "
"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));
@ -2990,8 +2990,8 @@ private:
"{ "
"int Format_T2 ; "
"} "
"int ( * * t1 ) ( ) ; "
"int ( * * t2 ) ( ) ;",
"int * * t1 ; "
"int * * t2 ;",
tok(code,false));
}