* parser.c (cp_parser_lambda_expression): Unset OK if there was an
error parsing the lambda-declarator.
From-SVN: r238563
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
* constexpr.c (cxx_eval_binary_expression): Handle comparison
between lowered and unlowered PTRMEM_CST.
ok &= cp_parser_lambda_declarator_opt (parser, lambda_expr);
+ if (ok && cp_parser_error_occurred (parser))
+ ok = false;
+
if (ok)
{
- if (!cp_parser_error_occurred (parser)
- && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)
+ if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)
&& cp_parser_start_tentative_firewall (parser))
start = token;
cp_parser_lambda_body (parser, lambda_expr);
--- /dev/null
+// PR c++/70781
+// { dg-do compile { target c++11 } }
+
+template < typename T >
+void foo ()
+{
+ T ([=] (S) { [=] {}; }); // { dg-error "" }
+}