fix #3070 (Other: failed to parse a typedef string. Check continues anyway.)
This commit is contained in:
parent
2667e34a07
commit
f4e07c3179
|
@ -1147,7 +1147,7 @@ void Tokenizer::simplifyTypedef()
|
|||
typeStart = tok->next();
|
||||
offset = 1;
|
||||
|
||||
while (Token::Match(tok->tokAt(offset), "const|signed|unsigned|struct|enum") ||
|
||||
while (Token::Match(tok->tokAt(offset), "const|signed|unsigned|struct|enum %type%") ||
|
||||
(tok->tokAt(offset + 1) && tok->tokAt(offset + 1)->isStandardType()))
|
||||
offset++;
|
||||
|
||||
|
|
|
@ -269,6 +269,7 @@ private:
|
|||
TEST_CASE(simplifyTypedef101); // ticket #3003 (segmentation fault)
|
||||
TEST_CASE(simplifyTypedef102); // ticket #3004
|
||||
TEST_CASE(simplifyTypedef103); // ticket #3007
|
||||
TEST_CASE(simplifyTypedef104); // ticket #3070
|
||||
|
||||
TEST_CASE(simplifyTypedefFunction1);
|
||||
TEST_CASE(simplifyTypedefFunction2); // ticket #1685
|
||||
|
@ -5418,6 +5419,13 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void simplifyTypedef104() // ticket #3070
|
||||
{
|
||||
const char code[] = "typedef int (*in_func) (void FAR *, unsigned char FAR * FAR *);\n";
|
||||
ASSERT_EQUALS(";", sizeof_(code));
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void simplifyTypedefFunction1()
|
||||
{
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue