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

Function isNonConstFunctionCall

lib/checkcondition.cpp:604–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602//---------------------------------------------------------------------------
603
604static bool isNonConstFunctionCall(const Token *ftok, const Library &library)
605{
606 if (library.isFunctionConst(ftok))
607 return false;
608 const Token *obj = ftok->next()->astOperand1();
609 while (obj && obj->str() == ".")
610 obj = obj->astOperand1();
611 if (!obj)
612 return true;
613 if (obj->variable() && obj->variable()->isConst())
614 return false;
615 if (ftok->function() && ftok->function()->isConst())
616 return false;
617 if (ftok->isControlFlowKeyword())
618 return false;
619 return true;
620}
621
622static bool isNestedInLambda(const Scope* inner, const Scope* outer)
623{

Callers 1

multiCondition2Method · 0.85

Calls 7

isFunctionConstMethod · 0.80
astOperand1Method · 0.80
nextMethod · 0.80
variableMethod · 0.80
isConstMethod · 0.80
strMethod · 0.45
functionMethod · 0.45

Tested by

no test coverage detected