From c49a8a99a35ee4b25cc6f82529c78aea2335c12f Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Sat, 6 Nov 2010 13:28:44 +0100 Subject: [PATCH] Fixed #2175 (Tokenizer::simplifyTypedef : wrong simplification of 'typedef float vec_t[3];') --- lib/tokenize.cpp | 2 +- test/testsimplifytokens.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 1c83337a9..611a47334 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -1629,7 +1629,7 @@ void Tokenizer::simplifyTypedef() tok2 = tok2->next()->next(); } } - while (Token::Match(tok2, ", %var% ;|'|=")); + while (Token::Match(tok2, ", %var% ;|'|=|,")); } simplifyType = false; diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index f9365139e..a6c8ce96b 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -4523,8 +4523,7 @@ private: const char code[] = "typedef float x[3];\n" "x a,b,c;\n"; 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 ; float c ;", actual); + ASSERT_EQUALS("; float a [ 3 ] ; float b [ 3 ] ; float c [ 3 ] ;", actual); ASSERT_EQUALS("", errout.str()); }