Skip to content

Commit 6ebba1f

Browse files
Update tokenlist.cpp
1 parent 6d03304 commit 6ebba1f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/tokenlist.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,11 +1787,11 @@ static Token * createAstAtToken(Token *tok)
17871787
}
17881788
}
17891789

1790-
if (Token::Match(tok, "%type% %name%|*|&|&&|::") && !Token::Match(tok, "return|new|delete")) {
1790+
if (Token::Match(tok, "%type%| %name%|*|&|&&|::") && !Token::Match(tok, "return|new|delete")) {
17911791
int typecount = 0;
17921792
Token *typetok = tok;
17931793
while (Token::Match(typetok, "%type%|::|*|&|&&|<")) {
1794-
if (typetok->isName() && !Token::simpleMatch(typetok->previous(), "::"))
1794+
if (typetok->isName() && (!Token::simpleMatch(typetok->previous(), "::") || tok->str() == "::"))
17951795
typecount++;
17961796
if (typetok->str() == "<") {
17971797
if (Token* closing = typetok->findClosingBracket()) {
@@ -1811,7 +1811,7 @@ static Token * createAstAtToken(Token *tok)
18111811
!Token::Match(tok, "return|throw") &&
18121812
Token::Match(typetok->previous(), "%name% ( !!*") &&
18131813
typetok->previous()->varId() == 0 &&
1814-
!typetok->previous()->isKeyword() &&
1814+
(!typetok->previous()->isKeyword() || typetok->previous()->isOperatorKeyword()) &&
18151815
(skipMethodDeclEnding(typetok->link()) || Token::Match(typetok->link(), ") ;|{")))
18161816
return typetok;
18171817
}

0 commit comments

Comments
 (0)