@@ -194,6 +194,7 @@ class TestConstructors : public TestFixture {
194194 TEST_CASE (uninitVarArray7);
195195 TEST_CASE (uninitVarArray8);
196196 TEST_CASE (uninitVarArray9); // ticket #6957, #6959
197+ TEST_CASE (uninitVarArray10);
197198 TEST_CASE (uninitVarArray2D);
198199 TEST_CASE (uninitVarArray3D);
199200 TEST_CASE (uninitVarCpp11Init1);
@@ -3117,6 +3118,28 @@ class TestConstructors : public TestFixture {
31173118 ASSERT_EQUALS (" [test.cpp:6]: (warning) Member variable 'sRAIUnitDef::List' is not initialized in the constructor.\n " , errout.str ());
31183119 }
31193120
3121+ void uninitVarArray10 () { // #11650
3122+ Settings s (settings);
3123+ LOAD_LIB_2 (s.library , " std.cfg" );
3124+ check (" struct T { int j; };\n "
3125+ " struct U { int k{}; };\n "
3126+ " struct S {\n "
3127+ " std::array<int, 2> a;\n "
3128+ " std::array<T, 2> b;\n "
3129+ " std::array<std::size_t, 2> c;\n "
3130+ " std::array<clock_t, 2> d;\n "
3131+ " std::array<std::string, 2> e;\n "
3132+ " std::array<U, 2> f;\n "
3133+ " S() {}\n "
3134+ " };\n " , s);
3135+
3136+ ASSERT_EQUALS (" [test.cpp:10]: (warning) Member variable 'S::a' is not initialized in the constructor.\n "
3137+ " [test.cpp:10]: (warning) Member variable 'S::b' is not initialized in the constructor.\n "
3138+ " [test.cpp:10]: (warning) Member variable 'S::c' is not initialized in the constructor.\n "
3139+ " [test.cpp:10]: (warning) Member variable 'S::d' is not initialized in the constructor.\n " ,
3140+ errout.str ());
3141+ }
3142+
31203143 void uninitVarArray2D () {
31213144 check (" class John\n "
31223145 " {\n "
0 commit comments