diff --git a/src/tokenize.cpp b/src/tokenize.cpp index 238a7e1f3..e02271016 100644 --- a/src/tokenize.cpp +++ b/src/tokenize.cpp @@ -759,7 +759,7 @@ void Tokenizer::setVarId() if (Token::simpleMatch(tok2, "std ::")) tok2 = tok2->tokAt(2); - while (tok2 && (tok2->isName() || tok2->str() == "*")) + while (tok2 && (tok2->isName() || tok2->str() == "*" || tok2->str() == ",")) tok2 = tok2->next(); if (Token::Match(tok2, "> %var%")) diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index b484df4d2..fd146838c 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -1274,7 +1274,8 @@ private: { const std::string code("list ints;\n" "list::iterator it;\n" - "std::vector dirs;\n"); + "std::vector dirs;\n" + "std::map coords;\n"); // tokenize.. Tokenizer tokenizer; @@ -1287,7 +1288,8 @@ private: const std::string expected("\n\n##file 0\n" "1: list < int > ints@1 ;\n" "2: list < int > :: iterator it@2 ;\n" - "3: std :: vector < std :: string > dirs@3 ;\n"); + "3: std :: vector < std :: string > dirs@3 ;\n" + "4: std :: map < int , int > coords@4 ;\n"); ASSERT_EQUALS(expected, actual); }