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