From 074274666e17a204d4435d92e75fa73cfa2a22e0 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 11 Dec 2008 23:04:46 +0000 Subject: [PATCH] If a declarator has no name, record the location of the start of the declaration as its source position. [r24552] --- parser.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index af961cc..d6a38d9 100644 --- a/parser.c +++ b/parser.c @@ -4850,8 +4850,12 @@ static entity_t *parse_declarator(const declaration_specifiers_t *specifiers, } } - entity->base.source_position = env.source_position; - entity->base.symbol = env.symbol; + if (env.symbol != NULL) { + entity->base.symbol = env.symbol; + entity->base.source_position = env.source_position; + } else { + entity->base.source_position = specifiers->source_position; + } entity->base.namespc = NAMESPACE_NORMAL; entity->declaration.type = orig_type; entity->declaration.modifiers = env.modifiers; -- 2.20.1