Commit 5e87bf4a by Taras Glek Committed by Taras Glek

* parser.c (cp_parser_class_specifier): Set class location to that of…

* parser.c (cp_parser_class_specifier): Set class location to that of IDENTIFIER_NODE instead of '{' when possible.\n* semantics.c (begin_class_definition): Do not overide locations with less precise ones.

From-SVN: r154890
parent 9ffd1183
2009-12-01 Taras Glek <taras@mozilla.com>
* parser.c (cp_parser_class_specifier): Set class location to that
of IDENTIFIER_NODE instead of '{' when possible.
2009-12-01 Taras Glek <taras@mozilla.com>
* semantics.c (begin_class_definition): Do not overide locations with less precise ones.
2009-12-01 Jason Merrill <jason@redhat.com> 2009-12-01 Jason Merrill <jason@redhat.com>
PR c++/41611 PR c++/41611
......
...@@ -16388,6 +16388,8 @@ cp_parser_class_head (cp_parser* parser, ...@@ -16388,6 +16388,8 @@ cp_parser_class_head (cp_parser* parser,
end_specialization (); end_specialization ();
--parser->num_template_parameter_lists; --parser->num_template_parameter_lists;
} }
DECL_SOURCE_LOCATION (TYPE_NAME (type)) = type_start_token->location;
*attributes_p = attributes; *attributes_p = attributes;
return type; return type;
} }
......
...@@ -2386,9 +2386,6 @@ begin_class_definition (tree t, tree attributes) ...@@ -2386,9 +2386,6 @@ begin_class_definition (tree t, tree attributes)
pushtag (make_anon_name (), t, /*tag_scope=*/ts_current); 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)) if (TYPE_BEING_DEFINED (t))
{ {
t = make_class_type (TREE_CODE (t)); t = make_class_type (TREE_CODE (t));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment