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

Function isOnlyUsedInCurrentScope

lib/checkother.cpp:1329–1336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1327}
1328
1329static bool isOnlyUsedInCurrentScope(const Variable* var, const Token *tok, const Scope* scope)
1330{
1331 if (tok->scope() == scope)
1332 return true;
1333 if (tok->scope()->type == ScopeType::eSwitch)
1334 return false;
1335 return !Token::findmatch(tok->scope()->bodyEnd, "%varid%", var->scope()->bodyEnd, var->declarationId());
1336}
1337
1338bool CheckOtherImpl::checkInnerScope(const Token *tok, const Variable* var, bool& used) const
1339{

Callers 1

checkInnerScopeMethod · 0.85

Calls 1

scopeMethod · 0.80

Tested by

no test coverage detected