aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaras Glek <taras@mozilla.com>2009-12-02 01:00:39 +0000
committerTaras Glek <tglek@gcc.gnu.org>2009-12-02 01:00:39 +0000
commit5e87bf4a142f66750f05b6319bf07b2dbf2c9f24 (patch)
tree9dcfcc8ddcab8a665737a6856820cf2548681ad7
parent9ffd1183773a31418653b565c1e619f561fdb6b5 (diff)
downloadgcc-5e87bf4a142f66750f05b6319bf07b2dbf2c9f24.zip
gcc-5e87bf4a142f66750f05b6319bf07b2dbf2c9f24.tar.gz
gcc-5e87bf4a142f66750f05b6319bf07b2dbf2c9f24.tar.bz2
* 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
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/cp/semantics.c3
3 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f0b9d7f..3a08602 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+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>
PR c++/41611
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 5c8dbcb..f50d1c0 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -16388,6 +16388,8 @@ cp_parser_class_head (cp_parser* parser,
end_specialization ();
--parser->num_template_parameter_lists;
}
+
+ DECL_SOURCE_LOCATION (TYPE_NAME (type)) = type_start_token->location;
*attributes_p = attributes;
return type;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 4a9bee7..aa79b22 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2386,9 +2386,6 @@ begin_class_definition (tree t, tree attributes)
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));