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

Function tokenIsFunctionReturningBool

lib/checkbool.cpp:187–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185//-------------------------------------------------------------------------------
186
187static bool tokenIsFunctionReturningBool(const Token* tok)
188{
189 const Function* func = tok ? tok->function() : nullptr;
190 if (func && Token::Match(tok, "%name% (")) {
191 if (func->tokenDef && Token::Match(func->tokenDef->previous(), "bool|_Bool")) {
192 return true;
193 }
194 }
195 return false;
196}
197
198void CheckBoolImpl::checkComparisonOfFuncReturningBool()
199{

Callers 1

Calls 1

functionMethod · 0.45

Tested by

no test coverage detected