Fixed #2175 (Tokenizer::simplifyTypedef : wrong simplification of 'typedef float vec_t[3];')

This commit is contained in:
Robert Reif 2010-11-06 13:28:44 +01:00 committed by Daniel Marjamäki
parent c39fbb86db
commit c49a8a99a3
2 changed files with 2 additions and 3 deletions

View File

@ -1629,7 +1629,7 @@ void Tokenizer::simplifyTypedef()
tok2 = tok2->next()->next(); tok2 = tok2->next()->next();
} }
} }
while (Token::Match(tok2, ", %var% ;|'|=")); while (Token::Match(tok2, ", %var% ;|'|=|,"));
} }
simplifyType = false; simplifyType = false;

View File

@ -4523,8 +4523,7 @@ private:
const char code[] = "typedef float x[3];\n" const char code[] = "typedef float x[3];\n"
"x a,b,c;\n"; "x a,b,c;\n";
const std::string actual(sizeof_(code)); const std::string actual(sizeof_(code));
TODO_ASSERT_EQUALS("; float a [ 3 ] ; float b [ 3 ] ; float c [ 3 ] ;", actual); ASSERT_EQUALS("; float a [ 3 ] ; float b [ 3 ] ; float c [ 3 ] ;", actual);
ASSERT_EQUALS("; float a [ 3 ] ; float b ; float c ;", actual);
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
} }