diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 81608d0f2..71af9366a 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -484,7 +484,7 @@ static Token * skipDecl(Token *tok) vartok = vartok->link(); else return tok; - } else if (Token::Match(vartok, "%name% [:=]")) { + } else if (Token::Match(vartok, "%var% [:=(]")) { return vartok; } vartok = vartok->next(); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index 4a6265489..ad508a98a 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -7484,10 +7484,11 @@ private: ASSERT_EQUALS("fora0=a8 c : d);")); - ASSERT_EQUALS("forde:(", testAst("for (a::b d : e);")); + ASSERT_EQUALS("forvarb:(", testAst("for (int *var : b);")); + ASSERT_EQUALS("forvard:(", testAst("for (a var : d);")); + ASSERT_EQUALS("forvare:(", testAst("for (a::b var : e);")); ASSERT_EQUALS("forx*0=yz;;(", testAst("for(*x=0;y;z)")); ASSERT_EQUALS("forx0=y(8