| 5284 | } |
| 5285 | |
| 5286 | static const Token* skipPointers(const Token* tok) |
| 5287 | { |
| 5288 | const Token *start = tok; |
| 5289 | bool memberPointer = false; |
| 5290 | while (tok) { |
| 5291 | if (Token::simpleMatch(tok, "::")) { |
| 5292 | tok = tok->next(); |
| 5293 | continue; |
| 5294 | } |
| 5295 | if (Token::Match(tok, "%type% ::")) { |
| 5296 | tok = tok->tokAt(2); |
| 5297 | memberPointer = true; |
| 5298 | continue; |
| 5299 | } |
| 5300 | if (Token::Match(tok, "%type% <") && tok->linkAt(1)) { |
| 5301 | tok = tok->linkAt(1)->next(); |
| 5302 | continue; |
| 5303 | } |
| 5304 | break; |
| 5305 | } |
| 5306 | if (memberPointer && !Token::simpleMatch(tok, "*")) |
| 5307 | return start; |
| 5308 | while (Token::Match(tok, "*|&|&&") || (Token::Match(tok, "( [*&]") && Token::Match(tok->link()->next(), "(|["))) { |
| 5309 | tok = tok->next(); |
| 5310 | if (tok && tok->strAt(-1) == "(" && Token::Match(tok, "%type% ::")) |
| 5311 | tok = tok->tokAt(2); |
| 5312 | } |
| 5313 | |
| 5314 | if (Token::simpleMatch(tok, "( *") && Token::simpleMatch(tok->link()->previous(), "] ) ;") && |
| 5315 | (tok->tokAt(-1)->isStandardType() || tok->tokAt(-1)->isKeyword() || tok->strAt(-1) == "*")) { |
| 5316 | const Token *tok2 = skipPointers(tok->next()); |
| 5317 | if (Token::Match(tok2, "%name% [") && Token::simpleMatch(tok2->linkAt(1), "] ) ;")) |
| 5318 | return tok2; |
| 5319 | } |
| 5320 | |
| 5321 | return tok; |
| 5322 | } |
| 5323 | |
| 5324 | static const Token* skipPointersAndQualifiers(const Token* tok) |
| 5325 | { |
no test coverage detected