simplify templates: show debug message when bailout out

This commit is contained in:
Daniel Marjamäki 2010-03-04 18:20:08 +01:00
parent b55a7f2815
commit d643bbe864
1 changed files with 8 additions and 7 deletions

View File

@ -1641,15 +1641,12 @@ void Tokenizer::simplifyTemplates()
else if (Token::Match(tok, "> %type% %type% *|&| %type% (")) else if (Token::Match(tok, "> %type% %type% *|&| %type% ("))
namepos = 3; namepos = 3;
else else
continue; {
if ((tok->tokAt(namepos)->str() == "*" || tok->tokAt(namepos)->str() == "&")) #ifndef NDEBUG
++namepos; // debug message that we bail out..
if (_settings && _settings->_debug) if (_settings && _settings->_debug)
{ {
if (!Token::Match(tok->tokAt(namepos), "%var%")) std::cout << "simplifyTemplates debug-information: bailing out: "
{
std::cout << "simplifyTemplates error: "
<< file(tok->tokAt(namepos)) << file(tok->tokAt(namepos))
<< ": " << ": "
<< tok->tokAt(namepos)->linenr() << tok->tokAt(namepos)->linenr()
@ -1657,7 +1654,11 @@ void Tokenizer::simplifyTemplates()
<< tok->tokAt(namepos)->str() << tok->tokAt(namepos)->str()
<< std::endl; << std::endl;
} }
#endif
continue;
} }
if ((tok->tokAt(namepos)->str() == "*" || tok->tokAt(namepos)->str() == "&"))
++namepos;
// name of template function/class.. // name of template function/class..
const std::string name(tok->strAt(namepos)); const std::string name(tok->strAt(namepos));