| 2980 | } |
| 2981 | |
| 2982 | void TemplateSimplifier::getTemplateParametersInDeclaration( |
| 2983 | const Token * tok, |
| 2984 | std::vector<const Token *> & typeParametersInDeclaration) |
| 2985 | { |
| 2986 | assert(tok->strAt(-1) == "<"); |
| 2987 | |
| 2988 | typeParametersInDeclaration.clear(); |
| 2989 | const Token *end = tok->previous()->findClosingBracket(); |
| 2990 | bool inDefaultValue = false; |
| 2991 | for (; tok && tok!= end; tok = tok->next()) { |
| 2992 | if (Token::simpleMatch(tok, "template <")) { |
| 2993 | const Token *closing = tok->next()->findClosingBracket(); |
| 2994 | if (closing) |
| 2995 | tok = closing->next(); |
| 2996 | } else if (tok->link() && Token::Match(tok, "{|(|[")) |
| 2997 | tok = tok->link(); |
| 2998 | else if (Token::Match(tok, "%name% ,|>|=")) { |
| 2999 | if (!inDefaultValue) { |
| 3000 | typeParametersInDeclaration.push_back(tok); |
| 3001 | if (tok->strAt(1) == "=") |
| 3002 | inDefaultValue = true; |
| 3003 | } |
| 3004 | } else if (inDefaultValue) { |
| 3005 | if (tok->str() == ",") |
| 3006 | inDefaultValue = false; |
| 3007 | else if (tok->str() == "<") { |
| 3008 | const Token *closing = tok->findClosingBracket(); |
| 3009 | if (closing) |
| 3010 | tok = closing; |
| 3011 | } |
| 3012 | } |
| 3013 | } |
| 3014 | } |
| 3015 | |
| 3016 | bool TemplateSimplifier::matchSpecialization( |
| 3017 | const Token *templateDeclarationNameToken, |
nothing calls this directly
no test coverage detected