Fix SymbolDatabase bailout to also support struct (#1160)
This commit is contained in:
parent
d8b3fa5c70
commit
8734e4dd38
|
@ -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;
|
||||
|
|
|
@ -2925,10 +2925,17 @@ 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 struct T<int> ; void foo() { }");
|
||||
ASSERT(db != nullptr);
|
||||
ASSERT(db && db->scopeList.size() == 2);
|
||||
}
|
||||
}
|
||||
|
||||
void enum1() {
|
||||
GET_SYMBOL_DB("enum BOOL { FALSE, TRUE }; enum BOOL b;");
|
||||
|
|
Loading…
Reference in New Issue