* semantics.c (lambda_return_type): Complain about
braced-init-list.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158805
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-04-27 Jason Merrill <jason@redhat.com>
+ PR c++/43875
+ * semantics.c (lambda_return_type): Complain about
+ braced-init-list.
+
PR c++/43790
* tree.c (cv_unqualified): Handle error_mark_node.
lambda_return_type (tree expr)
{
tree type;
+ if (BRACE_ENCLOSED_INITIALIZER_P (expr))
+ {
+ warning (0, "cannot deduce lambda return type from a braced-init-list");
+ return void_type_node;
+ }
if (type_dependent_expression_p (expr))
{
type = cxx_make_type (DECLTYPE_TYPE);
+2010-04-27 Jason Merrill <jason@redhat.com>
+
+ PR c++/43875
+ * g++.dg/cpp0x/lambda/lambda-deduce2.C: New.
+
2010-04-27 Manuel López-Ibáñez <manu@gcc.gnu.org>
Jan Hubicka <hubicka@ucw.cz>
--- /dev/null
+// PR c++/43875
+// { dg-options "-std=c++0x" }
+
+int main()
+{
+ auto x2 = []{ return { 1, 2 }; }; // { dg-message "return" }
+}