You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checkVirtualFunctionCallInConstructor; Check should be 'style' since there is no UB. Disabled the check temporarily, it should use CTU to determine if the class is a base class
"Virtual function '" + funcname + "' is called from " + scopeFunctionTypeName + " '" + constructorName + "' at line " + MathLib::toString(lineNumber) + ". Dynamic binding is not used.", CWE(0U), false);
Copy file name to clipboardExpand all lines: test/testclass.cpp
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6836,21 +6836,21 @@ class TestClass : public TestFixture {
6836
6836
"};\n"
6837
6837
"A::A()\n"
6838
6838
"{f();}\n");
6839
-
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());
6839
+
ASSERT_EQUALS("[test.cpp:7] -> [test.cpp:3]: (style) Virtual function 'f' is called from constructor 'A()' at line 7. Dynamic binding is not used.\n", errout.str());
6840
6840
6841
6841
checkVirtualFunctionCall("class A {\n"
6842
6842
" virtual int f();\n"
6843
6843
" A() {f();}\n"
6844
6844
"};\n"
6845
6845
"int A::f() { return 1; }\n");
6846
-
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());
6846
+
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (style) Virtual function 'f' is called from constructor 'A()' at line 3. Dynamic binding is not used.\n", errout.str());
6847
6847
6848
6848
checkVirtualFunctionCall("class A : B {\n"
6849
6849
" int f() override;\n"
6850
6850
" A() {f();}\n"
6851
6851
"};\n"
6852
6852
"int A::f() { return 1; }\n");
6853
-
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());
6853
+
ASSERT_EQUALS("[test.cpp:3] -> [test.cpp:2]: (style) Virtual function 'f' is called from constructor 'A()' at line 3. Dynamic binding is not used.\n", errout.str());
6854
6854
6855
6855
checkVirtualFunctionCall("class B {\n"
6856
6856
" virtual int f() = 0;\n"
@@ -6860,7 +6860,7 @@ class TestClass : public TestFixture {
6860
6860
" A() {f();}\n"
6861
6861
"};\n"
6862
6862
"int A::f() { return 1; }\n");
6863
-
ASSERT_EQUALS("[test.cpp:6] -> [test.cpp:5]: (warning) Virtual function 'f' is called from constructor 'A()' at line 6. Dynamic binding is not used.\n", errout.str());
6863
+
ASSERT_EQUALS("[test.cpp:6] -> [test.cpp:5]: (style) Virtual function 'f' is called from constructor 'A()' at line 6. Dynamic binding is not used.\n", errout.str());
0 commit comments