+2010-09-06 Arnaud Charlet <charlet@adacore.com>
+
+ * parser.c (make_pointer_declarator, make_reference_declarator,
+ make_call_declarator, make_array_declarator): Set declarator->id_loc.
+ (cp_parser_init_declarator): Adjust location of decl if appropriate.
+
2010-09-06 Jason Merrill <jason@redhat.com>
* call.c (implicit_conversion): Fix value-init of enums.
declarator->u.pointer.class_type = NULL_TREE;
if (target)
{
+ declarator->id_loc = target->id_loc;
declarator->parameter_pack_p = target->parameter_pack_p;
target->parameter_pack_p = false;
}
declarator->u.reference.rvalue_ref = rvalue_ref;
if (target)
{
+ declarator->id_loc = target->id_loc;
declarator->parameter_pack_p = target->parameter_pack_p;
target->parameter_pack_p = false;
}
declarator->u.function.late_return_type = late_return_type;
if (target)
{
+ declarator->id_loc = target->id_loc;
declarator->parameter_pack_p = target->parameter_pack_p;
target->parameter_pack_p = false;
}
declarator->u.array.bounds = bounds;
if (element)
{
+ declarator->id_loc = element->id_loc;
declarator->parameter_pack_p = element->parameter_pack_p;
element->parameter_pack_p = false;
}
decl = start_decl (declarator, decl_specifiers,
is_initialized, attributes, prefix_attributes,
&pushed_scope);
+ /* Adjust location of decl if declarator->id_loc is more appropriate:
+ set, and decl wasn't merged with another decl, in which case its
+ location would be different from input_location, and more accurate. */
+ if (DECL_P (decl)
+ && declarator->id_loc != UNKNOWN_LOCATION
+ && DECL_SOURCE_LOCATION (decl) == input_location)
+ DECL_SOURCE_LOCATION (decl) = declarator->id_loc;
}
else if (scope)
/* Enter the SCOPE. That way unqualified names appearing in the