diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index ef6b6ce6b..1548e7067 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -2413,10 +2413,9 @@ void CheckClass::pureVirtualFunctionCallInConstructorError( for (const Token *tok : tokStack) errorPath.emplace_back(tok, "Calling " + tok->str()); if (!errorPath.empty()) - // cppcheck-suppress unreadVariable // FP errorPath.back().second = purefuncname + " is a pure virtual method without body"; - reportError(tokStack, Severity::warning, "pureVirtualCall", + reportError(errorPath, Severity::warning, "pureVirtualCall", "$symbol:" + purefuncname +"\n" "Call of pure virtual function '$symbol' in " + scopeFunctionTypeName + ".\n" "Call of pure virtual function '$symbol' in " + scopeFunctionTypeName + ". The call will fail during runtime.", CWE(0U), false);