From 21ec772e310096ff328813914dff56d86336ca64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 8 Nov 2010 18:01:28 +0100 Subject: [PATCH] Tokenizer: Only show 'failed to instantiate template' debug messages if the --debug-warnings has been given --- lib/tokenize.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 4e875899f..daa5a2391 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2652,20 +2652,21 @@ void Tokenizer::simplifyTemplates() if (type2.empty() || type.size() != types2.size()) { -#ifndef NDEBUG - std::list locationList; - ErrorLogger::ErrorMessage::FileLocation loc; - loc.line = tok2->linenr(); - loc.setfile(file(tok2)); - locationList.push_back(loc); + if (_settings && _settings->debugwarnings) + { + std::list 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;