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

Method cppcast

test/testtokenize.cpp:8408–8420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8406 }
8407
8408 void cppcast() {
8409 const char code[] = "a = const_cast<int>(x);\n"
8410 "a = dynamic_cast<int>(x);\n"
8411 "a = reinterpret_cast<int>(x);\n"
8412 "a = static_cast<int>(x);\n";
8413
8414 SimpleTokenizer tokenizer(settingsDefault, *this);
8415 ASSERT(tokenizer.tokenize(code));
8416
8417 for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next()) {
8418 ASSERT_EQUALS(tok->str() == "(", tok->isCast());
8419 }
8420 }
8421
8422 void ccast() {
8423 const char code[] = "a = (int)x;\n" // #13579

Callers

nothing calls this directly

Calls 4

tokenizeMethod · 0.80
nextMethod · 0.80
isCastMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected