cp-tree.h (struct cp_declarator): New id_loc field.
authorPer Bothner <per@bothner.com>
Sat, 12 Mar 2005 06:39:31 +0000 (22:39 -0800)
committerPer Bothner <bothner@gcc.gnu.org>
Sat, 12 Mar 2005 06:39:31 +0000 (22:39 -0800)
* cp-tree.h (struct cp_declarator): New id_loc field.
* cp/parser.c (cp_lexer_get_preprocessor_token): Set cp_token's
location using c_lex_with_flags, instead of input_location.
(cp_parser_direct_declarator): Set declarator's id_loc from
cp_token's id_loc.

From-SVN: r96330

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c

index 5c02ee9f7083bc3f8c33e9b066183bb48f523167..2d9999287c71b89cea1bcad130b75c747158dc51 100644 (file)
@@ -1,3 +1,11 @@
+2005-03-11  Per Bothner  <per@bothner.com>
+
+       * cp-tree.h (struct cp_declarator): New id_loc field.
+       * cp/parser.c (cp_lexer_get_preprocessor_token): Set cp_token's
+       location using c_lex_with_flags, instead of input_location.
+       (cp_parser_direct_declarator): Set declarator's id_loc from
+       cp_token's id_loc.
+
 2005-03-10  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/18384, c++/18327
index 22d5f17a0cdcdb4212f2973f3ff630815a40b882..aef5637eaaeed5c0eef4fb12019a7fb9a1c71c81 100644 (file)
@@ -3597,6 +3597,7 @@ struct cp_declarator {
   /* For all but cdk_id and cdk_error, the contained declarator.  For
      cdk_id and cdk_error, guaranteed to be NULL.  */
   cp_declarator *declarator;
+  location_t id_loc; /* Currently only set for cdk_id. */
   union {
     /* For identifiers.  */
     struct {
index 3db7f2ee9f6d253ecc6100c4c5124910e088ab0e..6fb9fcad2809c8a0729a4193af8f937cd4c963e1 100644 (file)
@@ -380,8 +380,8 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED ,
   static int is_extern_c = 0;
 
    /* Get a new token from the preprocessor.  */
-  token->type = c_lex_with_flags (&token->value, &token->flags);
-  token->location = input_location;
+  token->type
+    = c_lex_with_flags (&token->value, &token->location, &token->flags);
   token->in_system_header = in_system_header;
 
   /* On some systems, some header files are surrounded by an 
@@ -11188,6 +11188,7 @@ cp_parser_direct_declarator (cp_parser* parser,
 
          declarator = make_id_declarator (qualifying_scope, 
                                           unqualified_name);
+         declarator->id_loc = token->location;
          if (unqualified_name)
            {
              tree class_type;