add virtual base class support to symbol database
This commit is contained in:
parent
3c5134bb21
commit
15fc071514
|
@ -1052,12 +1052,20 @@ const Token *SymbolDatabase::initBaseInfo(Scope *scope, const Token *tok)
|
|||
{
|
||||
Scope::BaseInfo base;
|
||||
|
||||
base.isVirtual = false;
|
||||
|
||||
tok2 = tok2->next();
|
||||
|
||||
// check for invalid code
|
||||
if (!tok2 || !tok2->next())
|
||||
return NULL;
|
||||
|
||||
if (tok2->str() == "virtual")
|
||||
{
|
||||
base.isVirtual = true;
|
||||
tok2 = tok2->next();
|
||||
}
|
||||
|
||||
if (tok2->str() == "public")
|
||||
{
|
||||
base.access = Public;
|
||||
|
@ -1081,6 +1089,12 @@ const Token *SymbolDatabase::initBaseInfo(Scope *scope, const Token *tok)
|
|||
base.access = Public;
|
||||
}
|
||||
|
||||
if (tok2->str() == "virtual")
|
||||
{
|
||||
base.isVirtual = true;
|
||||
tok2 = tok2->next();
|
||||
}
|
||||
|
||||
// handle derived base classes
|
||||
while (Token::Match(tok2, "%var% ::"))
|
||||
{
|
||||
|
|
|
@ -369,6 +369,7 @@ public:
|
|||
struct BaseInfo
|
||||
{
|
||||
AccessControl access; // public/protected/private
|
||||
bool isVirtual;
|
||||
std::string name;
|
||||
Scope *scope;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue