From 999fbed7f42cd9e46d204899e2d54902e6da5a55 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 1 Dec 2015 10:45:18 -0500 Subject: [PATCH 13/26] FIXME: bugfix in cp_parser_postfix_dot_deref_expression --- gcc/cp/parser.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f64ff3d..6f74c03 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -7121,18 +7121,19 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser, if (parser->scope && name && BASELINK_P (name)) adjust_result_of_qualified_name_lookup (name, parser->scope, scope); - /* Build a location e.g.: - ptr->field - ~~~^~~~~~~ - where the caret is at the deref token, ranging from - the start of postfix_expression to the end of the field name. */ - location_t combined_loc - = make_location (input_location, start_loc, - get_finish (token->location)); postfix_expression = finish_class_member_access_expr (postfix_expression, name, template_p, tf_warning_or_error); + /* Build a location e.g.: + ptr->access_expr + ~~~^~~~~~~~~~~~~ + where the caret is at the deref token, ranging from + the start of postfix_expression to the end of the access expr. */ + location_t end_loc + = get_finish (cp_lexer_previous_token (parser->lexer)->location); + location_t combined_loc + = make_location (input_location, start_loc, end_loc); protected_set_expr_location (postfix_expression, combined_loc); } } -- 1.8.5.3