| 3384 | } |
| 3385 | |
| 3386 | static bool matchTemplateParameters(const Token *nameTok, const std::list<std::string> &strings) |
| 3387 | { |
| 3388 | const Token *tok = nameTok->tokAt(2); |
| 3389 | const Token *end = nameTok->next()->findClosingBracket(); |
| 3390 | if (!end) |
| 3391 | return false; |
| 3392 | auto it = strings.cbegin(); |
| 3393 | while (tok && tok != end && it != strings.cend()) { |
| 3394 | if (tok->isUnsigned()) { |
| 3395 | if (*it != "unsigned") |
| 3396 | return false; |
| 3397 | |
| 3398 | ++it; |
| 3399 | if (it == strings.cend()) |
| 3400 | return false; |
| 3401 | } else if (tok->isSigned()) { |
| 3402 | if (*it != "signed") |
| 3403 | return false; |
| 3404 | |
| 3405 | ++it; |
| 3406 | if (it == strings.cend()) |
| 3407 | return false; |
| 3408 | } |
| 3409 | if (tok->isLong()) { |
| 3410 | if (*it != "long") |
| 3411 | return false; |
| 3412 | |
| 3413 | ++it; |
| 3414 | if (it == strings.cend()) |
| 3415 | return false; |
| 3416 | } |
| 3417 | if (*it != tok->str()) |
| 3418 | return false; |
| 3419 | tok = tok->next(); |
| 3420 | ++it; |
| 3421 | } |
| 3422 | return it == strings.cend() && tok && tok->str() == ">"; |
| 3423 | } |
| 3424 | |
| 3425 | void TemplateSimplifier::replaceTemplateUsage( |
| 3426 | const TokenAndName &instantiation, |
no test coverage detected