Skip to content

Commit c779cef

Browse files
Fix #11422 debug: Missing variable class for variable with varid (#4616)
1 parent 0cb7427 commit c779cef

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

lib/tokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5639,7 +5639,7 @@ void Tokenizer::removePragma()
56395639
void Tokenizer::removeMacroInClassDef()
56405640
{
56415641
for (Token *tok = list.front(); tok; tok = tok->next()) {
5642-
if (!Token::Match(tok, "class|struct %name% %name% {|:"))
5642+
if (!Token::Match(tok, "class|struct %name% %name% final| {|:"))
56435643
continue;
56445644

56455645
const bool nextIsUppercase = tok->next()->isUpperCaseName();

test/testtokenize.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6634,6 +6634,7 @@ class TestTokenizer : public TestFixture {
66346634
void removeMacroInClassDef() { // #6058
66356635
ASSERT_EQUALS("class Fred { } ;", tokenizeAndStringify("class DLLEXPORT Fred { } ;"));
66366636
ASSERT_EQUALS("class Fred : Base { } ;", tokenizeAndStringify("class Fred FINAL : Base { } ;"));
6637+
ASSERT_EQUALS("class Fred final : Base { } ;", tokenizeAndStringify("class DLLEXPORT Fred final : Base { } ;")); // #11422
66376638
// Regression for C code:
66386639
ASSERT_EQUALS("struct Fred { } ;", tokenizeAndStringify("struct DLLEXPORT Fred { } ;", true, Settings::Native, "test.c"));
66396640
}

0 commit comments

Comments
 (0)