Skip to content

Commit e907fdd

Browse files
committed
Fix #14483
1 parent fca8072 commit e907fdd

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

lib/symboldatabase.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5266,6 +5266,26 @@ const Variable *Scope::getVariable(const std::string &varname) const
52665266

52675267
static const Token* skipPointers(const Token* tok)
52685268
{
5269+
const Token *start = tok;
5270+
bool memberPointer = false;
5271+
while (tok) {
5272+
if (Token::simpleMatch(tok, "::")) {
5273+
tok = tok->next();
5274+
continue;
5275+
}
5276+
if (Token::Match(tok, "%type% ::")) {
5277+
tok = tok->tokAt(2);
5278+
memberPointer = true;
5279+
continue;
5280+
}
5281+
if (Token::Match(tok, "%type% <") && tok->linkAt(1)) {
5282+
tok = tok->linkAt(1)->next();
5283+
continue;
5284+
}
5285+
break;
5286+
}
5287+
if (memberPointer && !Token::simpleMatch(tok, "*"))
5288+
return start;
52695289
while (Token::Match(tok, "*|&|&&") || (Token::Match(tok, "( [*&]") && Token::Match(tok->link()->next(), "(|["))) {
52705290
tok = tok->next();
52715291
if (tok && tok->strAt(-1) == "(" && Token::Match(tok, "%type% ::"))

0 commit comments

Comments
 (0)