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

Function isConvertedToBool

lib/checkbool.cpp:75–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75static bool isConvertedToBool(const Token* tok)
76{
77 if (!tok->astParent())
78 return false;
79 return astIsBool(tok->astParent()) || Token::Match(tok->astParent()->previous(), "if|while (");
80}
81
82//---------------------------------------------------------------------------
83// if (bool & bool) -> if (bool && bool)

Callers 1

checkBitwiseOnBooleanMethod · 0.85

Calls 2

astIsBoolFunction · 0.85
astParentMethod · 0.80

Tested by

no test coverage detected