Skip to content

Commit ca62d2d

Browse files
Update tokenlist.cpp
1 parent c9ed9a9 commit ca62d2d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/tokenlist.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,9 +1765,18 @@ static Token * createAstAtToken(Token *tok)
17651765
if (Token::Match(tok, "%type% %name%|*|&|&&|::") && !Token::Match(tok, "return|new|delete")) {
17661766
int typecount = 0;
17671767
Token *typetok = tok;
1768-
while (Token::Match(typetok, "%type%|::|*|&|&&")) {
1768+
while (Token::Match(typetok, "%type%|::|*|&|&&|<")) {
17691769
if (typetok->isName() && !Token::simpleMatch(typetok->previous(), "::"))
17701770
typecount++;
1771+
if (typetok->str() == "<") {
1772+
if (Token* closing = typetok->findClosingBracket()) {
1773+
typetok = closing->next();
1774+
if (Token::simpleMatch(typetok, "::"))
1775+
typetok = typetok->next();
1776+
continue;
1777+
}
1778+
break;
1779+
}
17711780
typetok = typetok->next();
17721781
}
17731782
if (Token::Match(typetok, "%var% =") && typetok->varId())

0 commit comments

Comments
 (0)