Tokenizer: Only show 'failed to instantiate template' debug messages if the --debug-warnings has been given

This commit is contained in:
Daniel Marjamäki 2010-11-08 18:01:28 +01:00
parent 27b7638901
commit 21ec772e31
1 changed files with 13 additions and 12 deletions

View File

@ -2652,20 +2652,21 @@ void Tokenizer::simplifyTemplates()
if (type2.empty() || type.size() != types2.size())
{
#ifndef NDEBUG
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
ErrorLogger::ErrorMessage::FileLocation loc;
loc.line = tok2->linenr();
loc.setfile(file(tok2));
locationList.push_back(loc);
if (_settings && _settings->debugwarnings)
{
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
ErrorLogger::ErrorMessage::FileLocation loc;
loc.line = tok2->linenr();
loc.setfile(file(tok2));
locationList.push_back(loc);
const ErrorLogger::ErrorMessage errmsg(locationList,
Severity::debug,
"Failed to instantiate template. The checking continues anyway.",
"templateInstantiate");
const ErrorLogger::ErrorMessage errmsg(locationList,
Severity::debug,
"Failed to instantiate template. The checking continues anyway.",
"debug");
_errorLogger->reportErr(errmsg);
#endif
_errorLogger->reportErr(errmsg);
}
if (type2.empty())
continue;
break;