Fixed #1345 (Not initialised variables warning missing in classes with dllexport)

This commit is contained in:
Daniel Marjamäki 2010-02-03 20:01:56 +01:00
parent b01af012cd
commit d3b5889f88
2 changed files with 17 additions and 0 deletions

View File

@ -1009,6 +1009,16 @@ bool Tokenizer::tokenize(std::istream &code, const char FileName[], const std::s
}
}
// Remove __declspec(dllexport)
for (Token *tok = _tokens; tok; tok = tok->next())
{
if (Token::simpleMatch(tok, "__declspec ( dllexport )"))
{
Token::eraseTokens(tok, tok->tokAt(4));
tok->deleteThis();
}
}
// typedef..
simplifyTypedef();

View File

@ -186,6 +186,8 @@ private:
TEST_CASE(functionpointer);
TEST_CASE(removeRedundantAssignment);
TEST_CASE(removedeclspec);
}
@ -2900,6 +2902,11 @@ private:
ASSERT_EQUALS("void f ( ) { ; int * q ; ; }", tokenizeAndStringify("void f() { int *p, *q; p = q; }", true));
ASSERT_EQUALS("void f ( ) { ; ; int * q ; ; }", tokenizeAndStringify("void f() { int *p = 0, *q; p = q; }", true));
}
void removedeclspec()
{
ASSERT_EQUALS("a b", tokenizeAndStringify("a __declspec ( dllexport ) b"));
}
};
REGISTER_TEST(TestTokenizer)