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

Function isAssignedToNonLocal

lib/checkautovariables.cpp:553–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551}
552
553static bool isAssignedToNonLocal(const Token* tok)
554{
555 if (!Token::simpleMatch(tok->astParent(), "="))
556 return false;
557 if (!astIsRHS(tok))
558 return false;
559 const Variable* var = getParentVar(tok->astParent()->astOperand1());
560 if (!var)
561 return false;
562 return !var->isLocal() || var->isStatic();
563}
564
565void CheckAutoVariablesImpl::checkVarLifetimeScope(const Token * start, const Token * end)
566{

Callers 1

checkVarLifetimeScopeMethod · 0.85

Calls 5

astIsRHSFunction · 0.85
getParentVarFunction · 0.85
astParentMethod · 0.80
astOperand1Method · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected