Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/testother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class TestOther : public TestFixture
TEST_CASE(testMisusedScopeObjectDoesNotPickLocalClassConstructors);
TEST_CASE(testMisusedScopeObjectDoesNotPickUsedObject);
TEST_CASE(testMisusedScopeObjectDoesNotPickPureC);
TEST_CASE(testMisusedScopeObjectDoesNotPickNestedClass);
TEST_CASE(trac2071);
TEST_CASE(trac2084);

Expand Down Expand Up @@ -1358,6 +1359,27 @@ class TestOther : public TestFixture
ASSERT_EQUALS("", errout.str());
}

void testMisusedScopeObjectDoesNotPickNestedClass()
{
const char code[] = "class ios_base {\n"
"public:\n"
" class Init {\n"
" public:\n"
" };\n"
"};\n"
"class foo {\n"
"public:\n"
" foo();\n"
" void Init(int);\n"
"};\n"
"foo::foo() {\n"
" Init(0);\n"
"}\n";

check(code, "test.cpp");
ASSERT_EQUALS("", errout.str());
}

void trac2084()
{
check("#include <signal.h>\n"
Expand Down