+2010-05-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/44045
+ * typeck.c (cp_build_modify_expr): Complain about assignment to
+ array from init list.
+
2010-05-10 Fabien ChĂȘne <fabien.chene@gmail.com>
PR c++/43719
if (BRACE_ENCLOSED_INITIALIZER_P (newrhs))
{
+ if (modifycode != INIT_EXPR)
+ {
+ if (complain & tf_error)
+ error ("assigning to an array from an initializer list");
+ return error_mark_node;
+ }
if (check_array_initializer (lhs, lhstype, newrhs))
return error_mark_node;
newrhs = digest_init (lhstype, newrhs);
+2010-05-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/44045
+ * g++.dg/cpp0x/initlist33.C: New.
+ * g++.dg/cpp0x/initlist26.C: Adjust.
+ * g++.dg/cpp0x/initlist28.C: Adjust.
+
2010-05-10 Fabien ChĂȘne <fabien.chene@gmail.com>
PR c++/43719
foo (int i)
{
int a[i];
- a = { }; // { dg-error "may not be initialized" }
+ a = { }; // { dg-error "assign" }
}
void foo()
{
int a[1];
- throw a = {}; // { dg-error "invalid use of non-lvalue array" }
+ throw a = {}; // { dg-error "assign" }
}
--- /dev/null
+// PR c++/44045
+// { dg-options "-std=c++0x" }
+
+struct base
+{
+ virtual ~base() { }
+};
+
+int main()
+{
+ base ptr_array[1];
+ ptr_array = { base() }; // { dg-error "assign" }
+}