File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments