Skip to content

Commit 194a1be

Browse files
Add test for #4792 (#3573)
1 parent 10109a5 commit 194a1be

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

test/testconstructors.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,23 @@ class TestConstructors : public TestFixture {
19861986
"}");
19871987
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
19881988

1989+
// constructor outside namespace with using, #4792
1990+
check("namespace Output\n"
1991+
"{\n"
1992+
" class Foo\n"
1993+
" {\n"
1994+
" public:\n"
1995+
" Foo();\n"
1996+
" private:\n"
1997+
" bool mMember;\n"
1998+
" };\n"
1999+
"}\n"
2000+
"using namespace Output;"
2001+
"Foo::Foo()\n"
2002+
"{\n"
2003+
"}");
2004+
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
2005+
19892006
// constructor in separate namespace
19902007
check("namespace Output\n"
19912008
"{\n"

0 commit comments

Comments
 (0)