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

Function findEnumeratorInUsingList

lib/symboldatabase.cpp:5502–5516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5500}
5501
5502static const Enumerator* findEnumeratorInUsingList(const Scope* scope, const std::string& name)
5503{
5504 for (const auto& u : scope->usingList) {
5505 if (!u.scope)
5506 continue;
5507 for (const Scope* nested : u.scope->nestedList) {
5508 if (nested->type != ScopeType::eEnum)
5509 continue;
5510 const Enumerator* e = nested->findEnumerator(name);
5511 if (e && !(e->scope && e->scope->enumClass))
5512 return e;
5513 }
5514 }
5515 return nullptr;
5516}
5517
5518const Enumerator * SymbolDatabase::findEnumerator(const Token * tok, std::set<std::string>& tokensThatAreNotEnumeratorValues) const
5519{

Callers 1

findEnumeratorMethod · 0.85

Calls 1

findEnumeratorMethod · 0.80

Tested by

no test coverage detected