PR c++/59349
* parser.c (cp_parser_lambda_introducer): Handle empty init.
From-SVN: r206192
+2013-12-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/59349
+ * parser.c (cp_parser_lambda_introducer): Handle empty init.
+
2013-12-23 Stuart Hastings <stuart@apple.com>
Bill Maddox <maddox@google.com>
Jason Merrill <jason@redhat.com>
capture_init_expr = cp_parser_initializer (parser, &direct,
&non_constant);
explicit_init_p = true;
+ if (capture_init_expr == NULL_TREE)
+ {
+ error ("empty initializer for lambda init-capture");
+ capture_init_expr = error_mark_node;
+ }
}
else
{
--- /dev/null
+// PR c++/59349
+// { dg-options "-std=c++1y" }
+
+int foo () {
+ [bar()]{}; // { dg-error "empty initializer" }
+}