Skip to content

Commit 32f052d

Browse files
Update testconstructors.cpp
1 parent 0eb4dd8 commit 32f052d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/testconstructors.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ class TestConstructors : public TestFixture {
173173
TEST_CASE(uninitVar34); // ticket #10841
174174
TEST_CASE(uninitVar35);
175175
TEST_CASE(uninitVar36);
176+
TEST_CASE(uninitVar37);
176177
TEST_CASE(uninitVarEnum1);
177178
TEST_CASE(uninitVarEnum2); // ticket #8146
178179
TEST_CASE(uninitVarStream);
@@ -3031,6 +3032,15 @@ class TestConstructors : public TestFixture {
30313032
ASSERT_EQUALS("[test.cpp:5:5]: (warning) Member variable 'S::b' is not initialized in the constructor. [uninitMemberVar]\n", errout_str());
30323033
}
30333034

3035+
void uninitVar37() {
3036+
const Settings s = settingsBuilder(settings).library("std.cfg").build();
3037+
check("struct C {\n" // #13989
3038+
" C() = default;\n"
3039+
" std::list<int>::const_iterator it;\n"
3040+
"};\n", dinit(CheckOptions, $.inconclusive = true, $.s = &s));
3041+
ASSERT_EQUALS("[test.cpp:2:5]: (warning) Member variable 'C::it' is not initialized in the constructor. [uninitMemberVar]\n", errout_str());
3042+
}
3043+
30343044
void uninitVarArray1() {
30353045
check("class John\n"
30363046
"{\n"

0 commit comments

Comments
 (0)