diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 75bc440b8..24a85ee2a 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -759,7 +759,7 @@ void Tokenizer::setVarId() while (Token::Match(tok2, "%var% ::")) tok2 = tok2->tokAt(2); - while (tok2 && (tok2->isName() || tok2->str() == "*" || tok2->str() == ",")) + while (tok2 && (tok2->isName() || tok2->isNumber() || tok2->str() == "*" || tok2->str() == ",")) tok2 = tok2->next(); if (Token::Match(tok2, "> %var%")) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index dcd16a857..9d43ececd 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -1300,6 +1300,7 @@ private: "std::list tokens;\n" "static std::vector ex1;\n" "extern std::vector ex2;\n" + "std::map m;\n" ); // tokenize.. @@ -1319,6 +1320,7 @@ private: "6: std :: list < boost :: wave :: token_id > tokens@6 ;\n" "7: static std :: vector < CvsProcess * > ex1@7 ;\n" "8: extern std :: vector < CvsProcess * > ex2@8 ;\n" + "9: std :: map < int , 1 > m@9 ;\n" ); ASSERT_EQUALS(expected, actual);