Fixed #1178 (1.39: Internal error)

This commit is contained in:
Daniel Marjamäki 2010-01-01 21:06:30 +01:00
parent 071b7b463d
commit ddfd0b948e
2 changed files with 9 additions and 1 deletions

View File

@ -1724,7 +1724,7 @@ void Tokenizer::simplifyNamespaces()
{ {
for (Token *token = _tokens; token; token = token->next()) for (Token *token = _tokens; token; token = token->next())
{ {
while (token && token->str() == "namespace" && while (token && token->str() == "namespace" && token->varId() == 0 &&
(!token->previous() || token->previous()->str() != "using")) (!token->previous() || token->previous()->str() != "using"))
{ {
// Token is namespace and there is no "using" before it. // Token is namespace and there is no "using" before it.

View File

@ -1576,6 +1576,14 @@ private:
ASSERT_EQUALS(expected, sizeof_(code)); ASSERT_EQUALS(expected, sizeof_(code));
} }
{
const char code[] = "void f(int namespace) { }";
const std::string expected("void f ( int namespace ) { }");
ASSERT_EQUALS(expected, sizeof_(code));
}
} }