* call.c (reference_binding): Return NULL for initializer list with
error operand inside of it.
* g++.dg/cpp0x/initlist27.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154238
138bc75d-0d04-0410-961f-
82ee72b054a4
2009-11-17 Jakub Jelinek <jakub@redhat.com>
+ PR c++/42061
+ * call.c (reference_binding): Return NULL for initializer list with
+ error operand inside of it.
+
PR c++/42059
* typeck.c (cp_build_modify_expr): For initializer list call
check_array_initializer to make sure lhs isn't a VLA.
&& CONSTRUCTOR_NELTS (expr) == 1)
{
expr = CONSTRUCTOR_ELT (expr, 0)->value;
+ if (error_operand_p (expr))
+ return NULL;
from = TREE_TYPE (expr);
}
}
2009-11-17 Jakub Jelinek <jakub@redhat.com>
+ PR c++/42061
+ * g++.dg/cpp0x/initlist27.C: New test.
+
PR c++/42059
* g++.dg/cpp0x/initlist26.C: New test.
--- /dev/null
+// PR c++/42061
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+int& i = { j }; // { dg-error "invalid initialization|was not declared" }