Fixed #1178 (1.39: Internal error)
This commit is contained in:
parent
071b7b463d
commit
ddfd0b948e
|
@ -1724,7 +1724,7 @@ void Tokenizer::simplifyNamespaces()
|
|||
{
|
||||
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 is namespace and there is no "using" before it.
|
||||
|
|
|
@ -1576,6 +1576,14 @@ private:
|
|||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue