===================================================================
@@ -1162,6 +1162,10 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t)
}
}
break;
+
+ case LAMBDA_EXPR:
+ pp_cxx_ws_string (pp, "<lambda>");
+ break;
default:
pp_c_expression (pp_c_base (pp), t);
===================================================================
@@ -2494,6 +2494,10 @@ dump_expr (tree t, int flags)
dump_expr (resolve_virtual_fun_from_obj_type_ref (t), flags);
break;
+ case LAMBDA_EXPR:
+ pp_string (cxx_pp, M_("<lambda>"));
+ break;
+
/* This list is incomplete, but should suffice for now.
It is very important that `sorry' does not call
`report_error_function'. That could cause an infinite loop. */
===================================================================
@@ -0,0 +1,10 @@
+// PR c++/51412
+// { dg-do compile { target c++11 } }
+
+void foo(int);
+
+template<int> void bar()
+{
+ foo([]{}...); // { dg-error "<lambda>" }
+ foo([]{}=0 ...); // { dg-error "<lambda>" }
+}