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;
|
Token *tok2 = type0;
|
||||||
unsigned int typelen = 1;
|
unsigned int typelen = 1;
|
||||||
|
|
||||||
while (Token::Match(tok2, "%type% %type% *| %var%"))
|
while (Token::Match(tok2, "%type% %type% *| *| %var%"))
|
||||||
{
|
{
|
||||||
if (tok2->str() == "const")
|
if (tok2->str() == "const")
|
||||||
isconst = true;
|
isconst = true;
|
||||||
|
@ -1031,6 +1031,22 @@ private:
|
|||||||
ASSERT_EQUALS(" void foo ( ) { char * a ; char * b ; delete a ; delete b ; }", sizeof_(code));
|
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"
|
const char code[] = "void foo()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user