Fixed ticket #564 (set variable id for "struct ABC **p")
http://sourceforge.net/apps/trac/cppcheck/ticket/564
This commit is contained in:
parent
80953633ee
commit
d719606201
|
@ -2263,7 +2263,7 @@ bool Tokenizer::simplifyVarDecl()
|
|||
Token *tok2 = type0;
|
||||
unsigned int typelen = 1;
|
||||
|
||||
while (Token::Match(tok2, "%type% %type% *| %var%"))
|
||||
while (Token::Match(tok2, "%type% %type% *| *| %var%"))
|
||||
{
|
||||
if (tok2->str() == "const")
|
||||
isconst = true;
|
||||
|
|
|
@ -1031,6 +1031,22 @@ private:
|
|||
ASSERT_EQUALS(" void foo ( ) { char * a ; char * b ; delete a ; delete b ; }", sizeof_(code));
|
||||
}
|
||||
|
||||
{
|
||||
const char code[] = "void foo()\n"
|
||||
"{\n"
|
||||
" struct A *a, *b;\n"
|
||||
"}\n";
|
||||
ASSERT_EQUALS(" void foo ( ) { struct A * a ; struct A * b ; }", sizeof_(code));
|
||||
}
|
||||
|
||||
{
|
||||
const char code[] = "void foo()\n"
|
||||
"{\n"
|
||||
" struct A **a, **b;\n"
|
||||
"}\n";
|
||||
ASSERT_EQUALS(" void foo ( ) { struct A * * a ; struct A * * b ; }", sizeof_(code));
|
||||
}
|
||||
|
||||
{
|
||||
const char code[] = "void foo()\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue