Add test for #4792 (#3573)

This commit is contained in:
chrchr-github 2021-11-20 08:52:27 +01:00 committed by GitHub
parent 10109a5ef7
commit 194a1be2c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -1986,6 +1986,23 @@ private:
"}");
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
// constructor outside namespace with using, #4792
check("namespace Output\n"
"{\n"
" class Foo\n"
" {\n"
" public:\n"
" Foo();\n"
" private:\n"
" bool mMember;\n"
" };\n"
"}\n"
"using namespace Output;"
"Foo::Foo()\n"
"{\n"
"}");
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
// constructor in separate namespace
check("namespace Output\n"
"{\n"