Skip to content

Commit

Permalink
Add test for #9960 (#7266)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Jan 27, 2025
1 parent 48cc356 commit b9644e7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/testsymboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5675,6 +5675,21 @@ class TestSymbolDatabase : public TestFixture {
ASSERT_EQUALS(3, db->scopeList.size());
ASSERT_EQUALS(Scope::ScopeType::eFor, db->scopeList.back().type);
ASSERT_EQUALS(1, db->scopeList.back().varlist.size());
ASSERT_EQUALS("i", db->scopeList.back().varlist.back().name());
}
{
GET_SYMBOL_DB_DBG("void bar(int) {}\n" // #9960
"void foo() {\n"
" std::vector<int*> a(10);\n"
" for (int i = 0; i < 10; i++)\n"
" bar(*a[4]);\n"
"}\n");
ASSERT(db != nullptr);
ASSERT_EQUALS("", errout_str());
ASSERT_EQUALS(4, db->scopeList.size());
ASSERT_EQUALS(Scope::ScopeType::eFor, db->scopeList.back().type);
ASSERT_EQUALS(1, db->scopeList.back().varlist.size());
ASSERT_EQUALS("i", db->scopeList.back().varlist.back().name());
}
}

Expand Down

0 comments on commit b9644e7

Please sign in to comment.