Skip to content

Commit 44edaf4

Browse files
committed
add test with namespace
1 parent 5b3f18e commit 44edaf4

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
@@ -243,6 +243,7 @@ class TestConstructors : public TestFixture {
243243
TEST_CASE(inheritedCtor8);
244244
TEST_CASE(inheritedCtor9);
245245
TEST_CASE(inheritedCtor10);
246+
TEST_CASE(inheritedCtor11);
246247
}
247248

248249

@@ -4788,6 +4789,15 @@ class TestConstructors : public TestFixture {
47884789
ASSERT_EQUALS("", errout_str());
47894790
}
47904791

4792+
void inheritedCtor11() {
4793+
check("namespace X { struct Base { Base(int); }; }\n"
4794+
"struct Derived : X::Base {\n"
4795+
" using X::Base::Base;\n"
4796+
" int x;\n"
4797+
"};\n");
4798+
ASSERT_EQUALS("[test.cpp:3:20]: (warning) Member variable 'Derived::x' is not initialized in the constructor inherited from 'Base'. [uninitMemberVar]\n", errout_str());
4799+
}
4800+
47914801
};
47924802

47934803
REGISTER_TEST(TestConstructors)

0 commit comments

Comments
 (0)