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

Function isRangeForScope

lib/valueflow.cpp:1880–1891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1878 const Settings &settings);
1879
1880static bool isRangeForScope(const Scope* scope)
1881{
1882 if (!scope)
1883 return false;
1884 if (scope->type != ScopeType::eFor)
1885 return false;
1886 if (!scope->bodyStart)
1887 return false;
1888 if (!Token::simpleMatch(scope->bodyStart->previous(), ") {"))
1889 return false;
1890 return Token::simpleMatch(scope->bodyStart->linkAt(-1)->astOperand2(), ":");
1891}
1892
1893static const Token* getEndOfVarScope(const Variable* var)
1894{

Callers 1

getEndOfVarScopeFunction · 0.85

Calls 3

astOperand2Method · 0.80
linkAtMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected