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

Function previousBeforeAstLeftmostLeafGeneric

lib/astutils.cpp:526–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
527static T* previousBeforeAstLeftmostLeafGeneric(T* tok)
528{
529 if (!tok)
530 return nullptr;
531 T* leftmostLeaf = tok;
532 while (leftmostLeaf->astOperand1())
533 leftmostLeaf = leftmostLeaf->astOperand1();
534 return leftmostLeaf->previous();
535}
536
537const Token* previousBeforeAstLeftmostLeaf(const Token* tok)
538{

Callers 1

Calls 1

astOperand1Method · 0.80

Tested by

no test coverage detected