parent
122e142726
commit
502d7ea6db
|
@ -5616,13 +5616,6 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
|
|||
// If typedef handling is refactored and moved to symboldatabase someday we can remove this
|
||||
prepareTernaryOpForAST();
|
||||
|
||||
for (Token* tok = list.front(); tok;) {
|
||||
if (Token::Match(tok, "union|struct|class union|struct|class"))
|
||||
tok->deleteNext();
|
||||
else
|
||||
tok = tok->next();
|
||||
}
|
||||
|
||||
// class x y {
|
||||
if (isCPP() && mSettings->severity.isEnabled(Severity::information)) {
|
||||
for (const Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
|
|
|
@ -103,6 +103,7 @@ private:
|
|||
TEST_CASE(varid_for_2);
|
||||
TEST_CASE(varid_cpp_keywords_in_c_code);
|
||||
TEST_CASE(varid_cpp_keywords_in_c_code2); // #5373: varid=0 for argument called "delete"
|
||||
TEST_CASE(varid_cpp_keywords_in_c_code3);
|
||||
TEST_CASE(varidFunctionCall1);
|
||||
TEST_CASE(varidFunctionCall2);
|
||||
TEST_CASE(varidFunctionCall3);
|
||||
|
@ -1298,6 +1299,12 @@ private:
|
|||
tokenize(code, "test.c");
|
||||
}
|
||||
|
||||
void varid_cpp_keywords_in_c_code3() { // #12120
|
||||
const char code[] = "const struct class *p;";
|
||||
const char expected[] = "1: const struct class * p@1 ;\n";
|
||||
ASSERT_EQUALS(expected, tokenize(code, "test.c"));
|
||||
}
|
||||
|
||||
void varidFunctionCall1() {
|
||||
const char code[] ="void f() {\n"
|
||||
" int x;\n"
|
||||
|
|
Loading…
Reference in New Issue