commit 25a7d8c9be6a926081d2a0460984366fa49bbe22
Author: Jason Merrill <jason@redhat.com>
Date: Thu Feb 16 10:28:57 2012 -0800
PR c++/51415
* error.c (dump_expr): Handle lambda closures specifically.
@@ -2189,6 +2189,8 @@ dump_expr (tree t, int flags)
}
}
}
+ if (TREE_TYPE (t) && LAMBDA_TYPE_P (TREE_TYPE (t)))
+ pp_string (cxx_pp, "<lambda closure object>");
if (TREE_TYPE (t) && EMPTY_CONSTRUCTOR_P (t))
{
dump_type (TREE_TYPE (t), 0);
new file mode 100644
@@ -0,0 +1,8 @@
+// PR c++/51415
+// { dg-do compile { target c++11 } }
+
+void foo()
+{
+ int x[1];
+ [x]{} = 0; // { dg-error "lambda closure" }
+}