diff --git a/lib/templatesimplifier.cpp b/lib/templatesimplifier.cpp index ec87f8260..5dcc6d82d 100644 --- a/lib/templatesimplifier.cpp +++ b/lib/templatesimplifier.cpp @@ -1271,9 +1271,9 @@ bool TemplateSimplifier::simplifyTemplateInstantiations( if (typeForNewName.empty() || typeParametersInDeclaration.size() != typesUsedInTemplateInstantiation.size()) { if (_settings->debugwarnings && errorlogger) { - std::list callstack(1, tok); + std::list callstack(1, tok2); errorlogger->reportErr(ErrorLogger::ErrorMessage(callstack, &tokenlist, Severity::debug, "debug", - "Failed to instantiate template. The checking continues anyway.", false)); + "Failed to instantiate template \"" + name + "\". The checking continues anyway.", false)); } if (typeForNewName.empty()) continue;