Fixed #1827 (### Internal error in Cppcheck. Please report it.)
This commit is contained in:
parent
c949a29d1e
commit
1799e4a575
|
@ -1477,11 +1477,16 @@ void Tokenizer::simplifyTypedef()
|
||||||
// skip over name
|
// skip over name
|
||||||
if (tok2->next()->str() != ")")
|
if (tok2->next()->str() != ")")
|
||||||
{
|
{
|
||||||
tok2 = tok2->next();
|
if (tok2->next()->str() != "(")
|
||||||
|
tok2 = tok2->next();
|
||||||
|
|
||||||
// check for function and skip over args
|
// check for function and skip over args
|
||||||
if (tok2->next()->str() == "(")
|
if (tok2->next()->str() == "(")
|
||||||
tok2 = tok2->next()->link();
|
tok2 = tok2->next()->link();
|
||||||
|
|
||||||
|
// check for array
|
||||||
|
if (tok2->next()->str() == "[")
|
||||||
|
tok2 = tok2->next()->link();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -4128,6 +4128,7 @@ private:
|
||||||
"typedef char (& type3)[x];\n"
|
"typedef char (& type3)[x];\n"
|
||||||
"typedef char (& type4)[x + 2];\n"
|
"typedef char (& type4)[x + 2];\n"
|
||||||
"type1 t1;\n"
|
"type1 t1;\n"
|
||||||
|
"type1 (*tp1)[2];\n"
|
||||||
"type2 t2;\n"
|
"type2 t2;\n"
|
||||||
"type3 t3;\n"
|
"type3 t3;\n"
|
||||||
"type4 t4;";
|
"type4 t4;";
|
||||||
|
@ -4135,6 +4136,7 @@ private:
|
||||||
// The expected result..
|
// The expected result..
|
||||||
const std::string expected("; ; ; ; "
|
const std::string expected("; ; ; ; "
|
||||||
"char ( * t1 ) [ 10 ] ; "
|
"char ( * t1 ) [ 10 ] ; "
|
||||||
|
"char ( * ( * tp1 ) [ 2 ] ) [ 10 ] ; "
|
||||||
"char ( & t2 ) [ 10 ] ; "
|
"char ( & t2 ) [ 10 ] ; "
|
||||||
"char ( & t3 ) [ x ] ; "
|
"char ( & t3 ) [ x ] ; "
|
||||||
"char ( & t4 ) [ x + 2 ] ;");
|
"char ( & t4 ) [ x + 2 ] ;");
|
||||||
|
|
Loading…
Reference in New Issue