MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / removeExtraTemplateKeywords

Method removeExtraTemplateKeywords

lib/tokenize.cpp:6587–6608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6585}
6586
6587void Tokenizer::removeExtraTemplateKeywords()
6588{
6589 if (isCPP()) {
6590 for (Token *tok = list.front(); tok; tok = tok->next()) {
6591 if (Token::Match(tok, "%name%|>|) .|:: template %name%")) {
6592 tok->next()->deleteNext();
6593 Token* templateName = tok->tokAt(2);
6594 while (Token::Match(templateName, "%name%|::")) {
6595 templateName->isTemplate(true);
6596 templateName = templateName->next();
6597 }
6598 if (!templateName)
6599 syntaxError(tok);
6600 if (Token::Match(templateName->previous(), "operator %op%|(")) {
6601 templateName->isTemplate(true);
6602 if (templateName->str() == "(" && templateName->link())
6603 templateName->link()->isTemplate(true);
6604 }
6605 }
6606 }
6607 }
6608}
6609
6610static std::string getExpression(const Token *tok)
6611{

Callers

nothing calls this directly

Calls 6

isCPPFunction · 0.85
frontMethod · 0.80
nextMethod · 0.80
deleteNextMethod · 0.80
tokAtMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected