This commit is contained in:
parent
0cb742701d
commit
c779cefa61
|
@ -5639,7 +5639,7 @@ void Tokenizer::removePragma()
|
|||
void Tokenizer::removeMacroInClassDef()
|
||||
{
|
||||
for (Token *tok = list.front(); tok; tok = tok->next()) {
|
||||
if (!Token::Match(tok, "class|struct %name% %name% {|:"))
|
||||
if (!Token::Match(tok, "class|struct %name% %name% final| {|:"))
|
||||
continue;
|
||||
|
||||
const bool nextIsUppercase = tok->next()->isUpperCaseName();
|
||||
|
|
|
@ -6634,6 +6634,7 @@ private:
|
|||
void removeMacroInClassDef() { // #6058
|
||||
ASSERT_EQUALS("class Fred { } ;", tokenizeAndStringify("class DLLEXPORT Fred { } ;"));
|
||||
ASSERT_EQUALS("class Fred : Base { } ;", tokenizeAndStringify("class Fred FINAL : Base { } ;"));
|
||||
ASSERT_EQUALS("class Fred final : Base { } ;", tokenizeAndStringify("class DLLEXPORT Fred final : Base { } ;")); // #11422
|
||||
// Regression for C code:
|
||||
ASSERT_EQUALS("struct Fred { } ;", tokenizeAndStringify("struct DLLEXPORT Fred { } ;", true, Settings::Native, "test.c"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue