template simplifier: fix cppcheck warnings (#1793)
This commit is contained in:
parent
e47b6bf862
commit
3094026e59
|
@ -365,6 +365,8 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
|
||||||
tok = tok->link();
|
tok = tok->link();
|
||||||
if (tok)
|
if (tok)
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
|
if (!tok)
|
||||||
|
return 0;
|
||||||
if (tok->str() == ">" && level == 0)
|
if (tok->str() == ">" && level == 0)
|
||||||
return numberOfParameters;
|
return numberOfParameters;
|
||||||
else if (tok->str() == "," && level == 0) {
|
else if (tok->str() == "," && level == 0) {
|
||||||
|
@ -2333,8 +2335,8 @@ const Token * TemplateSimplifier::getTemplateParametersInDeclaration(
|
||||||
std::vector<const Token *> & typeParametersInDeclaration)
|
std::vector<const Token *> & typeParametersInDeclaration)
|
||||||
{
|
{
|
||||||
typeParametersInDeclaration.clear();
|
typeParametersInDeclaration.clear();
|
||||||
const Token *closing = tok->previous()->findClosingBracket();
|
const Token *end = tok->previous()->findClosingBracket();
|
||||||
for (; tok && tok!= closing; tok = tok->next()) {
|
for (; tok && tok!= end; tok = tok->next()) {
|
||||||
if (Token::simpleMatch(tok, "template <")) {
|
if (Token::simpleMatch(tok, "template <")) {
|
||||||
const Token *closing = tok->next()->findClosingBracket();
|
const Token *closing = tok->next()->findClosingBracket();
|
||||||
if (closing)
|
if (closing)
|
||||||
|
|
Loading…
Reference in New Issue