From c0e11c6afb448b0a9423b62c86c207945a0f5335 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 18 Jun 2018 20:38:38 -0400 Subject: [PATCH] Use a range for LAMBDA_EXPR_LOCATION. * parser.c (cp_parser_lambda_expression): Use a range for LAMBDA_EXPR_LOCATION. From-SVN: r261727 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/parser.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a671476..3e3b610 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2018-06-18 Jason Merrill + * parser.c (cp_parser_lambda_expression): Use a range for + LAMBDA_EXPR_LOCATION. + PR c++/86200 - ICE with unexpanded pack in lambda parameter. * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Also look into the function type. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index edb0ef8..ae9267e 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10198,6 +10198,12 @@ cp_parser_lambda_expression (cp_parser* parser) /* And now that we're done, push proxies for an enclosing lambda. */ insert_pending_capture_proxies (); + /* Update the lambda expression to a range. */ + cp_token *end_tok = cp_lexer_previous_token (parser->lexer); + LAMBDA_EXPR_LOCATION (lambda_expr) = make_location (token->location, + token->location, + end_tok->location); + if (ok) lambda_expr = build_lambda_object (lambda_expr); else -- 2.7.4