]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* parser.c (cp_parser_class_specifier): Set class location to that of IDENTIFIER_NODE...
authorTaras Glek <taras@mozilla.com>
Wed, 2 Dec 2009 01:00:39 +0000 (01:00 +0000)
committerTaras Glek <tglek@gcc.gnu.org>
Wed, 2 Dec 2009 01:00:39 +0000 (01:00 +0000)
From-SVN: r154890

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/cp/semantics.c

index f0b9d7f9f32a91c217186ebde018b29f9dbb28ae..3a086021776830a9f2cf1da6433afda452eb4c8b 100644 (file)
@@ -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
index 5c8dbcb155e70f6f95e5277e0dd2255888a82cf2..f50d1c0bb8dcb79e71207804295b6bd2fbcc57dd 100644 (file)
@@ -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;
 }
index 4a9bee7162408e14ec458ccb4601dac62c3c15c5..aa79b22a33fce36a7cbfefa2bdb0df2a11414a32 100644 (file)
@@ -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));