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

Function getLoopContainer

lib/checkstl.cpp:1060–1068  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1058}
1059
1060static const Token* getLoopContainer(const Token* tok)
1061{
1062 if (!Token::simpleMatch(tok, "for ("))
1063 return nullptr;
1064 const Token* sepTok = tok->next()->astOperand2();
1065 if (!Token::simpleMatch(sepTok, ":"))
1066 return nullptr;
1067 return sepTok->astOperand2();
1068}
1069
1070static const ValueFlow::Value* getInnerLifetime(const Token* tok,
1071 nonneg int id,

Callers 1

invalidContainerMethod · 0.85

Calls 3

astOperand2Method · 0.80
nextMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected