+2006-06-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/28018
+ * typeck.c (build_modify_expr): Disallow array assignment.
+
2006-06-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
* cp-tree.def: Fix typo.
/* Allow array assignment in compiler-generated code. */
if (! DECL_ARTIFICIAL (current_function_decl))
- pedwarn ("ISO C++ forbids assignment of arrays");
+ {
+ error ("array used as initializer");
+ return error_mark_node;
+ }
from_array = TREE_CODE (TREE_TYPE (newrhs)) == ARRAY_TYPE
? 1 + (modifycode != INIT_EXPR): 0;
2006-06-14 Mark Mitchell <mark@codesourcery.com>
+ PR c++/28018
+ * g++.old-deja/g++.benjamin/14664-2.C: Expect error for array
+ assignment.
+ * g++.old-deja/g++.pt/crash51.C: Likewise.
+
PR c++/27227
* g++.dg/lookup/linkage1.C: New test.
* g++.dg/lookup/linkage2.C: Likewise.
void bar()
{
- // the addition of the flag "-fno-const-string-literal" reverts to pre-ISO.
- // -g++: ANSI C++ forbids assignment of arrays
- foo = "0123456789012345678901234"; // WARNING -
+ foo = "0123456789012345678901234"; // { dg-error "array" }
}
template <class T>
void f ()
{
- foo = "0123456789012345678901234";
+ foo = "0123456789012345678901234"; // { dg-error "array" }
}
template void f<int>();