From: Per Bothner Date: Sat, 12 Mar 2005 06:39:31 +0000 (-0800) Subject: cp-tree.h (struct cp_declarator): New id_loc field. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b68b68289b79f5aaa432ff03e5c4f978529fba18;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5c02ee9f708..2d9999287c7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2005-03-11 Per Bothner + + * 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 PR c++/18384, c++/18327 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 22d5f17a0cd..aef5637eaae 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 3db7f2ee9f6..6fb9fcad280 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;