Added test for #6171

This commit is contained in:
Robert Reif 2014-10-15 21:41:15 +02:00 committed by PKEuS
parent eab0878b8a
commit 45a2986f34
1 changed files with 22 additions and 0 deletions

View File

@ -227,6 +227,7 @@ private:
TEST_CASE(symboldatabase43); // #4738
TEST_CASE(symboldatabase44);
TEST_CASE(symboldatabase45); // #6125
TEST_CASE(symboldatabase46); // #6171 (anonymous namespace)
TEST_CASE(isImplicitlyVirtual);
@ -1983,6 +1984,27 @@ private:
ASSERT_EQUALS(Scope::eFunction, scope->type);
}
void symboldatabase46() { // #6171 (anonymous namespace)
GET_SYMBOL_DB("struct S { };\n"
"namespace {\n"
" struct S { };\n"
"}");
ASSERT(db != nullptr);
ASSERT_EQUALS(4U, db->scopeList.size());
std::list<Scope>::const_iterator scope = db->scopeList.begin();
ASSERT_EQUALS(Scope::eGlobal, scope->type);
++scope;
ASSERT_EQUALS(Scope::eStruct, scope->type);
ASSERT_EQUALS(scope->className, "S");
++scope;
ASSERT_EQUALS(Scope::eNamespace, scope->type);
ASSERT_EQUALS(scope->className, "");
++scope;
ASSERT_EQUALS(Scope::eStruct, scope->type);
ASSERT_EQUALS(scope->className, "S");
}
void isImplicitlyVirtual() {
{
GET_SYMBOL_DB("class Base {\n"