mirror of git://gcc.gnu.org/git/gcc.git
PR c++/70781 - ICE on ill-formed lambda.
* parser.c (cp_parser_lambda_expression): Unset OK if there was an error parsing the lambda-declarator. From-SVN: r238563
This commit is contained in:
parent
dd5dda561e
commit
172f0e1311
|
|
@ -1,5 +1,9 @@
|
||||||
2016-07-21 Jason Merrill <jason@redhat.com>
|
2016-07-21 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/70781
|
||||||
|
* parser.c (cp_parser_lambda_expression): Unset OK if there was an
|
||||||
|
error parsing the lambda-declarator.
|
||||||
|
|
||||||
PR c++/71896
|
PR c++/71896
|
||||||
* constexpr.c (cxx_eval_binary_expression): Handle comparison
|
* constexpr.c (cxx_eval_binary_expression): Handle comparison
|
||||||
between lowered and unlowered PTRMEM_CST.
|
between lowered and unlowered PTRMEM_CST.
|
||||||
|
|
|
||||||
|
|
@ -9771,10 +9771,12 @@ cp_parser_lambda_expression (cp_parser* parser)
|
||||||
|
|
||||||
ok &= cp_parser_lambda_declarator_opt (parser, lambda_expr);
|
ok &= cp_parser_lambda_declarator_opt (parser, lambda_expr);
|
||||||
|
|
||||||
|
if (ok && cp_parser_error_occurred (parser))
|
||||||
|
ok = false;
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
if (!cp_parser_error_occurred (parser)
|
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)
|
||||||
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)
|
|
||||||
&& cp_parser_start_tentative_firewall (parser))
|
&& cp_parser_start_tentative_firewall (parser))
|
||||||
start = token;
|
start = token;
|
||||||
cp_parser_lambda_body (parser, lambda_expr);
|
cp_parser_lambda_body (parser, lambda_expr);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
// PR c++/70781
|
||||||
|
// { dg-do compile { target c++11 } }
|
||||||
|
|
||||||
|
template < typename T >
|
||||||
|
void foo ()
|
||||||
|
{
|
||||||
|
T ([=] (S) { [=] {}; }); // { dg-error "" }
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue