From 259464d4db2d27591ae683cfd2bd234286d6cec4 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 20 May 2012 08:33:52 +0200 Subject: [PATCH] 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. --- parser.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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); } -- 2.20.1