diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 842c2a535..35e9eee66 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -285,6 +285,41 @@ void CheckClass::createSymbolDatabase() } } } + + std::multimap::iterator it; + + // finish filling in base class info + for (it = spaceInfoMMap.begin(); it != spaceInfoMMap.end(); ++it) + { + info = it->second; + + // skip namespaces + if (info->isNamespace) + continue; + + for (unsigned int i = 0; i < info->derivedFrom.size(); ++i) + { + std::multimap::iterator it1; + + for (it1 = spaceInfoMMap.begin(); it1 != spaceInfoMMap.end(); ++it1) + { + SpaceInfo *spaceInfo = it1->second; + + /** @todo handle derived base classes and namespaces */ + if (!spaceInfo->isNamespace) + { + if (spaceInfo->className == info->derivedFrom[i].name) + { + if (spaceInfo->nest == info->nest) + { + info->derivedFrom[i].spaceInfo = spaceInfo; + break; + } + } + } + } + } + } } CheckClass::~CheckClass() @@ -345,26 +380,6 @@ const Token *CheckClass::initBaseInfo(SpaceInfo *info, const Token *tok) base.spaceInfo = 0; - std::multimap::iterator i; - - for (i = spaceInfoMMap.begin(); i != spaceInfoMMap.end(); ++i) - { - SpaceInfo *spaceInfo = i->second; - - /** @todo handle derived base classes and namespaces */ - if (!spaceInfo->isNamespace) - { - if (spaceInfo->className == base.name) - { - if (spaceInfo->nest == info->nest) - { - base.spaceInfo = spaceInfo; - break; - } - } - } - } - // save pattern for base class name info->derivedFrom.push_back(base); }