Skip to content

Commit ed7a13a

Browse files
Update testconstructors.cpp
1 parent d0c2336 commit ed7a13a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/testconstructors.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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() {

0 commit comments

Comments
 (0)