diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index b95dc1371..bacf7ccd5 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -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% ::")) { diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index a4814106c..37f94d59c 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -369,6 +369,7 @@ public: struct BaseInfo { AccessControl access; // public/protected/private + bool isVirtual; std::string name; Scope *scope; };