Re-enable okenizer::removeMacroInClassDef for C code

This commit is contained in:
amai2012 2015-09-01 07:10:12 +02:00
parent 04209c08cf
commit e683d31e71
2 changed files with 2 additions and 2 deletions

View File

@ -3916,8 +3916,6 @@ void Tokenizer::removeMacrosInGlobalScope()
void Tokenizer::removeMacroInClassDef()
{
if (!isCPP())
return;
for (Token *tok = list.front(); tok; tok = tok->next()) {
if (Token::Match(tok, "class|struct %name% %name% {|:") &&
(tok->next()->isUpperCaseName() || tok->tokAt(2)->isUpperCaseName())) {

View File

@ -8708,6 +8708,8 @@ private:
void removeMacroInClassDef() { // #6058
ASSERT_EQUALS("class Fred { } ;", tokenizeAndStringify("class DLLEXPORT Fred { } ;"));
ASSERT_EQUALS("class Fred : Base { } ;", tokenizeAndStringify("class Fred FINAL : Base { } ;"));
// Regression for C code:
ASSERT_EQUALS("struct Fred { } ;", tokenizeAndStringify("struct DLLEXPORT Fred { } ;", false, true, Settings::Unspecified, "test.c"));
}
void sizeofAddParentheses() {