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

Function getContainerFunction

lib/astutils.cpp:291–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291static std::pair<const Token*, const Library::Container*> getContainerFunction(const Token* tok, const Library& library)
292{
293 const Library::Container* cont{};
294 if (!tok || !tok->valueType() || (!tok->valueType()->container && (!(cont = library.detectContainerOrIterator(tok->valueType()->smartPointerTypeToken)))))
295 return {};
296 const Token* parent = tok->astParent();
297 if (Token::Match(parent, ". %name% [(<]") && astIsLHS(tok)) {
298 return { parent->next(), cont ? cont : tok->valueType()->container };
299 }
300 return {};
301}
302
303Library::Container::Action astContainerAction(const Token* tok, const Library& library, const Token** ftok)
304{

Callers 2

astContainerActionFunction · 0.85
astContainerYieldFunction · 0.85

Calls 4

astIsLHSFunction · 0.85
astParentMethod · 0.80
nextMethod · 0.80

Tested by

no test coverage detected