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

Method cppKeywordInCSource

test/testtokenize.cpp:8396–8406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8394 }
8395
8396 void cppKeywordInCSource() {
8397 ASSERT_NO_THROW(tokenizeAndStringify("int throw() {}", dinit(TokenizeOptions, $.cpp = false)));
8398
8399 const char code[] = "void requires(const char*);\n" // #14613
8400 "void f() { requires(\"abc\"); }\n";
8401 ASSERT_NO_THROW(tokenizeAndStringify(code, dinit(TokenizeOptions, $.cpp = false)));
8402 const Settings s_cpp17 = settingsBuilder().cpp(Standards::CPP17).build();
8403 ASSERT_NO_THROW(tokenizeAndStringify(code, s_cpp17, true));
8404 const Settings s_cpp20 = settingsBuilder().cpp(Standards::CPP20).build();
8405 ASSERT_THROW_INTERNAL(tokenizeAndStringify(code, s_cpp20, true), AST);
8406 }
8407
8408 void cppcast() {
8409 const char code[] = "a = const_cast<int>(x);\n"

Callers

nothing calls this directly

Calls 2

buildMethod · 0.80
cppMethod · 0.80

Tested by

no test coverage detected