templates: don't expand forward declarations for templates
This commit is contained in:
parent
a12fd4ff5e
commit
917a48cd65
|
@ -474,7 +474,21 @@ void Tokenizer::simplifyTemplates()
|
||||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||||
{
|
{
|
||||||
if (Token::simpleMatch(tok, "template <"))
|
if (Token::simpleMatch(tok, "template <"))
|
||||||
|
{
|
||||||
|
for (const Token *tok2 = tok; tok2; tok2 = tok2->next())
|
||||||
|
{
|
||||||
|
// Just a declaration => ignore this
|
||||||
|
if (tok2->str() == ";")
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Implementation => add to "templates"
|
||||||
|
if (tok2->str() == "{")
|
||||||
|
{
|
||||||
templates.push_back(tok);
|
templates.push_back(tok);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (templates.empty())
|
if (templates.empty())
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue