MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / hasCircularDependencies

Method hasCircularDependencies

lib/symboldatabase.cpp:3894–3913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3892}
3893
3894bool Type::hasCircularDependencies(std::set<BaseInfo>* ancestors) const
3895{
3896 std::set<BaseInfo> knownAncestors;
3897 if (!ancestors) {
3898 ancestors=&knownAncestors;
3899 }
3900 for (auto parent=derivedFrom.cbegin(); parent!=derivedFrom.cend(); ++parent) {
3901 if (!parent->type)
3902 continue;
3903 if (this==parent->type)
3904 return true;
3905 if (ancestors->find(*parent)!=ancestors->end())
3906 return true;
3907
3908 ancestors->insert(*parent);
3909 if (parent->type->hasCircularDependencies(ancestors))
3910 return true;
3911 }
3912 return false;
3913}
3914
3915bool Type::findDependency(const Type* ancestor) const
3916{

Callers 1

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected