check that misused scope object does not pick nested class

This commit is contained in:
Greg Hewgill 2011-02-01 08:07:41 +13:00
parent 386de53ff7
commit dcc0f28f34
1 changed files with 22 additions and 0 deletions

View File

@ -89,6 +89,7 @@ private:
TEST_CASE(testMisusedScopeObjectDoesNotPickLocalClassConstructors);
TEST_CASE(testMisusedScopeObjectDoesNotPickUsedObject);
TEST_CASE(testMisusedScopeObjectDoesNotPickPureC);
TEST_CASE(testMisusedScopeObjectDoesNotPickNestedClass);
TEST_CASE(trac2071);
TEST_CASE(trac2084);
@ -1358,6 +1359,27 @@ private:
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"