| 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" |