File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ class TestConstructors : public TestFixture {
9292 TEST_CASE (noConstructor13); // #9998
9393 TEST_CASE (noConstructor14); // #10770
9494 TEST_CASE (noConstructor15); // #5499
95+ TEST_CASE (noConstructor16);
9596
9697 TEST_CASE (forwardDeclaration); // ticket #4290/#3190
9798
@@ -758,6 +759,13 @@ class TestConstructors : public TestFixture {
758759 ASSERT_EQUALS (" [test.cpp:3:5]: (warning) Member variable 'C::i2' is not initialized in the constructor. [uninitMemberVar]\n " , errout_str ());
759760 }
760761
762+ void noConstructor16 () {
763+ check (" struct S {\n "
764+ " int a = 0, b;\n "
765+ " };\n " );
766+ ASSERT_EQUALS (" [test.cpp:1:10]: (warning) Member variable 'S::b' is not initialized in the constructor. [uninitMemberVar]\n " , errout_str ());
767+ }
768+
761769 // ticket #4290 "False Positive: style (noConstructor): The class 'foo' does not have a constructor."
762770 // ticket #3190 "SymbolDatabase: Parse of sub class constructor fails"
763771 void forwardDeclaration () {
You can’t perform that action at this time.
0 commit comments