Commit 5666bb32 by Jason Merrill Committed by Jason Merrill

re PR c++/42331 (ICE with invalid array initializer)

	PR c++/42331
	* typeck.c (cp_build_modify_expr): Fix thinko.

From-SVN: r155410
parent e19977d3
2009-12-22 Jason Merrill <jason@redhat.com>
PR c++/42331
* typeck.c (cp_build_modify_expr): Fix thinko.
2009-12-21 Jason Merrill <jason@redhat.com> 2009-12-21 Jason Merrill <jason@redhat.com>
* mangle.c (write_member_name): Move abi-version=1 code back to... * mangle.c (write_member_name): Move abi-version=1 code back to...
......
...@@ -6455,15 +6455,15 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, ...@@ -6455,15 +6455,15 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
{ {
int from_array; int from_array;
if (BRACE_ENCLOSED_INITIALIZER_P (rhs)) if (BRACE_ENCLOSED_INITIALIZER_P (newrhs))
{ {
if (check_array_initializer (lhs, lhstype, rhs)) if (check_array_initializer (lhs, lhstype, newrhs))
return error_mark_node; return error_mark_node;
rhs = digest_init (lhstype, rhs); newrhs = digest_init (lhstype, newrhs);
} }
else if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype), else if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype),
TYPE_MAIN_VARIANT (TREE_TYPE (rhs)))) TYPE_MAIN_VARIANT (TREE_TYPE (newrhs))))
{ {
if (complain & tf_error) if (complain & tf_error)
error ("incompatible types in assignment of %qT to %qT", error ("incompatible types in assignment of %qT to %qT",
......
2009-12-22 Jason Merrill <jason@redhat.com>
PR c++/42331
* g++.dg/cpp0x/initlist29.C: New.
2009-12-22 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk> 2009-12-22 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
PR target/41605 PR target/41605
......
// PR c++/42331
// { dg-options "-std=c++0x" }
class Mesh
{
public:
Mesh(const char*)
{ typele={0}; } // { dg-error "" }
private:
int typele[7][2];
};
Mesh m(0);
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