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

Method findTypeInBase

lib/tokenize.cpp:2516–2534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2514 }
2515
2516 bool findTypeInBase(const std::string &scope) const {
2517 if (scope.empty())
2518 return false;
2519 // check in base types first
2520 if (baseTypes.find(scope) != baseTypes.end())
2521 return true;
2522 // check in base types base types
2523 for (const std::string & base : baseTypes) {
2524 const ScopeInfo3 * baseScope = findScope(base);
2525 // bail on uninstantiated recursive template
2526 if (baseScope == this)
2527 return false;
2528 if (baseScope && baseScope->fullName == scope)
2529 return true;
2530 if (baseScope && baseScope->findTypeInBase(scope))
2531 return true;
2532 }
2533 return false;
2534 }
2535
2536 ScopeInfo3 * findScope(const ScopeInfo3 * scope) {
2537 if (scope->bodyStart == bodyStart)

Callers 1

usingMatchFunction · 0.80

Calls 4

findScopeFunction · 0.85
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected