templates: don't expand forward declarations for templates

This commit is contained in:
Daniel Marjamäki 2009-05-07 16:05:07 +02:00
parent a12fd4ff5e
commit 917a48cd65
1 changed files with 15 additions and 1 deletions

View File

@ -474,7 +474,21 @@ void Tokenizer::simplifyTemplates()
for (Token *tok = _tokens; tok; tok = tok->next())
{
if (Token::simpleMatch(tok, "template <"))
templates.push_back(tok);
{
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);
break;
}
}
}
}
if (templates.empty())
return;