Fix SymbolDatabase bailout to also support struct (#1160)

This commit is contained in:
IOBYTE 2018-04-09 12:53:55 -04:00 committed by Daniel Marjamäki
parent d8b3fa5c70
commit 8734e4dd38
2 changed files with 11 additions and 4 deletions

View File

@ -124,7 +124,7 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
else if (Token::Match(tok2, "%name% ["))
continue;
// skip template
else if (Token::simpleMatch(tok->previous(), "template class") &&
else if (Token::Match(tok->previous(), "template class|struct") &&
Token::simpleMatch(tok2->previous(), "> ;")) {
tok = tok2;
continue;

View File

@ -2925,9 +2925,16 @@ private:
}
void symboldatabase63() {
GET_SYMBOL_DB("template class T<int> ; void foo() { }");
ASSERT(db != nullptr);
ASSERT(db && db->scopeList.size() == 2);
{
GET_SYMBOL_DB("template class T<int> ; void foo() { }");
ASSERT(db != nullptr);
ASSERT(db && db->scopeList.size() == 2);
}
{
GET_SYMBOL_DB("template struct T<int> ; void foo() { }");
ASSERT(db != nullptr);
ASSERT(db && db->scopeList.size() == 2);
}
}
void enum1() {