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

Method markCppCasts

lib/tokenize.cpp:5650–5663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5648}
5649
5650void Tokenizer::markCppCasts()
5651{
5652 if (isC())
5653 return;
5654 for (Token* tok = list.front(); tok; tok = tok->next()) {
5655 if (Token::Match(tok, "const_cast|dynamic_cast|reinterpret_cast|static_cast")) {
5656 if (!Token::simpleMatch(tok->next(), "<") || !Token::simpleMatch(tok->linkAt(1), "> ("))
5657 syntaxError(tok);
5658 tok = tok->linkAt(1)->next();
5659 tok->isCast(true);
5660 }
5661 }
5662
5663}
5664
5665void Tokenizer::sizeofAddParentheses()
5666{

Callers

nothing calls this directly

Calls 6

frontMethod · 0.80
nextMethod · 0.80
linkAtMethod · 0.80
isCastMethod · 0.80
isCFunction · 0.70
simpleMatchFunction · 0.70

Tested by

no test coverage detected