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

Function isScope

lib/valueflow.cpp:2602–2614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2600}
2601
2602static bool isScope(const Token* tok)
2603{
2604 if (!tok)
2605 return false;
2606 if (!Token::simpleMatch(tok, "{"))
2607 return false;
2608 const Scope* scope = tok->scope();
2609 if (!scope)
2610 return false;
2611 if (!scope->bodyStart)
2612 return false;
2613 return scope->bodyStart == tok;
2614}
2615
2616static const Function* findConstructor(const Scope* scope, const Token* tok, const std::vector<const Token*>& args)
2617{

Callers 3

valueFlowLifetimeFunction · 0.85

Calls 2

scopeMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected