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

Method ccast

test/testtokenize.cpp:8422–8436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8420 }
8421
8422 void ccast() {
8423 const char code[] = "a = (int)x;\n" // #13579
8424 "int (*p)[10];\n"
8425 "b = (void (S::*)(int) const)&y;";
8426
8427 SimpleTokenizer tokenizer(settingsDefault, *this);
8428 ASSERT(tokenizer.tokenize(code));
8429
8430 const Token* par = Token::findsimplematch(tokenizer.tokens(), "(");
8431 ASSERT(par->isCast());
8432 par = Token::findsimplematch(par->next(), "(");
8433 ASSERT(!par->isCast());
8434 par = Token::findsimplematch(par->next(), "(");
8435 ASSERT(par->isCast());
8436 }
8437
8438#define checkHdrs(...) checkHdrs_(__FILE__, __LINE__, __VA_ARGS__)
8439 template<size_t size>

Callers

nothing calls this directly

Calls 4

findsimplematchFunction · 0.85
tokenizeMethod · 0.80
isCastMethod · 0.80
nextMethod · 0.80

Tested by

no test coverage detected