From: Christoph Mallon Date: Sun, 20 May 2012 06:33:52 +0000 (+0200) Subject: In parse_namespace_definition() always discard the found entity when it is not a... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=259464d4db2d27591ae683cfd2bd234286d6cec4;p=cparser In parse_namespace_definition() always discard the found entity when it is not a namespace, not only when it is in the current scope, too. --- diff --git a/parser.c b/parser.c index 25d0b9c..8fad0db 100644 --- a/parser.c +++ b/parser.c @@ -9640,13 +9640,11 @@ static void parse_namespace_definition(void) if (token.kind == T_IDENTIFIER) { symbol = token.base.symbol; entity = get_entity(symbol, NAMESPACE_NORMAL); - if (entity != NULL - && entity->kind != ENTITY_NAMESPACE - && entity->base.parent_scope == current_scope) { - if (is_entity_valid(entity)) { + if (entity && entity->kind != ENTITY_NAMESPACE) { + entity = NULL; + if (entity->base.parent_scope == current_scope && is_entity_valid(entity)) { error_redefined_as_different_kind(HERE, entity, ENTITY_NAMESPACE); } - entity = NULL; } eat(T_IDENTIFIER); }