Commit 76bd270a by Håkon Sandsmark Committed by Jason Merrill

PR c++/71546 - lambda init-capture with qualified-id.

	* parser.c (cp_parser_lambda_introducer): Clear scope after
	each lambda capture.

From-SVN: r258043
parent 10b5c982
2018-02-27 Håkon Sandsmark <hsandsmark@gmail.com>
PR c++/71546 - lambda init-capture with qualified-id.
* parser.c (cp_parser_lambda_introducer): Clear scope after
each lambda capture.
2018-02-27 Nathan Sidwell <nathan@acm.org>
PR c++/84426
......
......@@ -10440,6 +10440,12 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr)
capture_init_expr,
/*by_reference_p=*/capture_kind == BY_REFERENCE,
explicit_init_p);
/* If there is any qualification still in effect, clear it
now; we will be starting fresh with the next capture. */
parser->scope = NULL_TREE;
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
}
cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
// PR c++/71546
// { dg-do compile { target c++14 } }
namespace n { struct make_shared { }; }
int main()
{
int x1;
[e = n::make_shared (), x1]() {};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment