Commit cf24598a by Mark Mitchell Committed by Mark Mitchell

re PR c++/28018 (g++.dg/ext/complit1.C fails: in emit_move_insn, at expr.c:3275)

	PR c++/28018
	* typeck.c (build_modify_expr): Disallow array assignment.
	PR c++/28018
	* g++.old-deja/g++.benjamin/14664-2.C: Expect error for array
	assignment.
	* g++.old-deja/g++.pt/crash51.C: Likewise.

From-SVN: r114653
parent 438d94ed
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.
......
......@@ -5707,7 +5707,10 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
/* 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.
......@@ -7,9 +7,7 @@ char foo[26];
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" }
}
......
......@@ -7,7 +7,7 @@ char foo[26];
template <class T>
void f ()
{
foo = "0123456789012345678901234";
foo = "0123456789012345678901234"; // { dg-error "array" }
}
template void f<int>();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment