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
"The " + std::string(isStruct ? "struct" : "class") + " '$symbol' does not have a constructor although it has private member variables.\n"
971
-
"The " + std::string(isStruct ? "struct" : "class") + " '$symbol' does not have a constructor "
970
+
"The " + std::string(isStruct ? "struct" : "class") + " '$symbol' does not declare a constructor although it has private member variables which likely require initialization.\n"
971
+
"The " + std::string(isStruct ? "struct" : "class") + " '$symbol' does not declare a constructor "
972
972
"although it has private member variables. Member variables of builtin types are left "
973
973
"uninitialized when the class is instantiated. That may cause bugs or undefined behavior.", CWE398, Certainty::normal);
Copy file name to clipboardExpand all lines: test/testconstructors.cpp
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -242,14 +242,14 @@ class TestConstructors : public TestFixture {
242
242
"private:\n"
243
243
" int i;\n"
244
244
"};");
245
-
ASSERT_EQUALS("[test.cpp:1]: (style) The class 'Fred' does not have a constructor although it has private member variables.\n", errout.str());
245
+
ASSERT_EQUALS("[test.cpp:1]: (style) The class 'Fred' does not declare a constructor although it has private member variables which likely require initialization.\n", errout.str());
246
246
247
247
check("struct Fred\n"
248
248
"{\n"
249
249
"private:\n"
250
250
" int i;\n"
251
251
"};");
252
-
ASSERT_EQUALS("[test.cpp:1]: (style) The struct 'Fred' does not have a constructor although it has private member variables.\n", errout.str());
252
+
ASSERT_EQUALS("[test.cpp:1]: (style) The struct 'Fred' does not declare a constructor although it has private member variables which likely require initialization.\n", errout.str());
253
253
}
254
254
255
255
@@ -403,8 +403,8 @@ class TestConstructors : public TestFixture {
ASSERT_EQUALS("[test.cpp:2]: (style) The class 'Barney' does not have a constructor although it has private member variables.\n"
407
-
"[test.cpp:3]: (style) The class 'Wilma' does not have a constructor although it has private member variables.\n", errout.str());
406
+
ASSERT_EQUALS("[test.cpp:2]: (style) The class 'Barney' does not declare a constructor although it has private member variables which likely require initialization.\n"
407
+
"[test.cpp:3]: (style) The class 'Wilma' does not declare a constructor although it has private member variables which likely require initialization.\n", errout.str());
408
408
}
409
409
410
410
voidsimple9() { // ticket #4574
@@ -521,7 +521,7 @@ class TestConstructors : public TestFixture {
521
521
"{\n"
522
522
" int i;\n"
523
523
"};");
524
-
ASSERT_EQUALS("[test.cpp:1]: (style) The class 'Fred' does not have a constructor although it has private member variables.\n", errout.str());
524
+
ASSERT_EQUALS("[test.cpp:1]: (style) The class 'Fred' does not declare a constructor although it has private member variables which likely require initialization.\n", errout.str());
0 commit comments