Index: gcc/cp/semantics.c =================================================================== --- gcc/cp/semantics.c (revision 154303) +++ gcc/cp/semantics.c (working copy) @@ -2342,9 +2342,6 @@ pushtag (make_anon_name (), t, /*tag_scope=*/ts_current); } - /* Update the location of the decl. */ - DECL_SOURCE_LOCATION (TYPE_NAME (t)) = input_location; - if (TYPE_BEING_DEFINED (t)) { t = make_class_type (TREE_CODE (t)); Index: gcc/cp/parser.c =================================================================== --- gcc/cp/parser.c (revision 154303) +++ gcc/cp/parser.c (working copy) @@ -16366,6 +16366,8 @@ end_specialization (); --parser->num_template_parameter_lists; } + + DECL_SOURCE_LOCATION (TYPE_NAME (type)) = type_start_token->location; *attributes_p = attributes; return type; }