aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2005-03-11 22:39:31 -0800
committerPer Bothner <bothner@gcc.gnu.org>2005-03-11 22:39:31 -0800
commitb68b68289b79f5aaa432ff03e5c4f978529fba18 (patch)
treeab84c727f8411c748d1716bb8ec6b85eb9fa1fd4
parent6037d88d58ffcacc4ee354f4300910589dc5ce47 (diff)
downloadgcc-b68b68289b79f5aaa432ff03e5c4f978529fba18.zip
gcc-b68b68289b79f5aaa432ff03e5c4f978529fba18.tar.gz
gcc-b68b68289b79f5aaa432ff03e5c4f978529fba18.tar.bz2
cp-tree.h (struct cp_declarator): New id_loc field.
* 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
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/parser.c5
3 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5c02ee9..2d99992 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 22d5f17..aef5637 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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 {
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 3db7f2e..6fb9fca 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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;