Skip to content

Commit 7ceb7a8

Browse files
committed
add test
1 parent 4780cd2 commit 7ceb7a8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test/testsymboldatabase.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ class TestSymbolDatabase : public TestFixture {
319319
TEST_CASE(namespaces2);
320320
TEST_CASE(namespaces3); // #3854 - unknown macro
321321
TEST_CASE(namespaces4);
322+
TEST_CASE(namespaces5); // #13967
322323
TEST_CASE(needInitialization);
323324

324325
TEST_CASE(tryCatch1);
@@ -3209,6 +3210,18 @@ class TestSymbolDatabase : public TestFixture {
32093210
ASSERT_EQUALS(2U, fredAType->classDef->linenr());
32103211
}
32113212

3213+
void namespaces5() { // #13967
3214+
GET_SYMBOL_DB("namespace test {\n"
3215+
" template <int S>\n"
3216+
" struct Test { int x[S]; };\n"
3217+
" const Test<64> test;\n"
3218+
"}\n");
3219+
const Variable *x = db->getVariableFromVarId(2U);
3220+
ASSERT_EQUALS("x", x->name());
3221+
const Scope *scope = x->scope();
3222+
ASSERT_EQUALS("test", scope->nestedIn->className);
3223+
}
3224+
32123225
void needInitialization() {
32133226
{
32143227
GET_SYMBOL_DB_DBG("template <typename T>\n" // #10259

0 commit comments

Comments
 (0)