diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index d3ceadd2a..86320d232 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -2377,8 +2377,7 @@ void CheckClass::virtualFunctionCallInConstructorError( } reportError(errorPath, Severity::warning, "virtualCallInConstructor", - "Virtual function '" + funcname + "' is called from " + scopeFunctionTypeName + " '" + constructorName + "' at line " + MathLib::toString(lineNumber) + ".\n" - "Call of pure virtual function '" + funcname + "' in " + scopeFunctionTypeName + ". Dynamic binding is not used.", CWE(0U), false); + "Virtual function '" + funcname + "' is called from " + scopeFunctionTypeName + " '" + constructorName + "' at line " + MathLib::toString(lineNumber) + ". Dynamic binding is not used.", CWE(0U), false); } void CheckClass::pureVirtualFunctionCallInConstructorError( diff --git a/test/testclass.cpp b/test/testclass.cpp index 003340ef1..632cb097c 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -6533,14 +6533,14 @@ private: "};\n" "A::A()\n" "{f();}\n"); - ASSERT_EQUALS("[test.cpp:7] -> [test.cpp:3]: (warning) Virtual function 'f' is called from constructor 'A()' at line 7.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:7] -> [test.cpp:3]: (warning) Virtual function 'f' is called from constructor 'A()' at line 7. Dynamic binding is not used.\n", errout.str()); checkVirtualFunctionCall("class A {\n" " virtual int f();\n" " A() {f();}\n" "};\n" "int A::f() { return 1; }\n"); - ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (warning) Virtual function 'f' is called from constructor 'A()' at line 3.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (warning) Virtual function 'f' is called from constructor 'A()' at line 3. Dynamic binding is not used.\n", errout.str()); checkVirtualFunctionCall("class A\n" "{\n"