We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e600c3 commit d99d065Copy full SHA for d99d065
test/testconstructors.cpp
@@ -4165,6 +4165,18 @@ class TestConstructors : public TestFixture {
4165
" std::map<int, int>* pMap = nullptr;\n"
4166
"};\n");
4167
ASSERT_EQUALS("", errout_str());
4168
+
4169
+ check("struct S {\n" // #6294
4170
+ " S() : r(new int) {\n"
4171
+ " *p = 0;\n"
4172
+ " *(q) = 1;\n"
4173
+ " *r = 2;\n"
4174
+ " }\n"
4175
+ " int *p, *q, *r;\n"
4176
+ "};\n");
4177
+ ASSERT_EQUALS("[test.cpp:2:5]: (warning) Member variable 'S::p' is not initialized in the constructor. [uninitMemberVar]\n"
4178
+ "[test.cpp:2:5]: (warning) Member variable 'S::q' is not initialized in the constructor. [uninitMemberVar]\n",
4179
+ errout_str());
4180
}
4181
4182
void uninitConstVar() {
0 commit comments