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

Function isVoidStmt

lib/checkother.cpp:2311–2325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2309}
2310
2311static bool isVoidStmt(const Token *tok)
2312{
2313 if (Token::simpleMatch(tok, "( void"))
2314 return true;
2315 if (isCPPCast(tok) && tok->astOperand1() && Token::Match(tok->astOperand1()->next(), "< void *| >"))
2316 return true;
2317 const Token *tok2 = tok;
2318 while (tok2->astOperand1())
2319 tok2 = tok2->astOperand1();
2320 if (Token::simpleMatch(tok2->previous(), ")") && Token::simpleMatch(tok2->linkAt(-1), "( void"))
2321 return true;
2322 if (Token::simpleMatch(tok2, "( void"))
2323 return true;
2324 return Token::Match(tok2->previous(), "delete|throw|return");
2325}
2326
2327static bool isConstTop(const Token *tok)
2328{

Callers 1

Calls 5

isCPPCastFunction · 0.85
astOperand1Method · 0.80
nextMethod · 0.80
linkAtMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected