Fixed #618 (Tokenizer: Wrong handling of enum)
http://sourceforge.net/apps/trac/cppcheck/ticket/618
This commit is contained in:
parent
78d44e67ef
commit
ae413a1ef0
|
@ -3576,7 +3576,7 @@ bool Tokenizer::simplifyComma()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (Token::simpleMatch(tok, "= {"))
|
||||
if (Token::Match(tok, "=|enum {"))
|
||||
{
|
||||
tok = tok->next()->link();
|
||||
if (!tok)
|
||||
|
|
|
@ -1119,6 +1119,11 @@ private:
|
|||
ASSERT_EQUALS(" void f ( ) { for ( int a , b ; a < 10 ; a = a + 1 , b = b + 1 ) { ; } }", sizeof_(code));
|
||||
}
|
||||
|
||||
{
|
||||
const char code[] = " typedef enum { a = 0 , b = 1 , c = 2 } abc ;";
|
||||
ASSERT_EQUALS(code, sizeof_(code));
|
||||
}
|
||||
|
||||
{
|
||||
const char code[] = "void f()\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue