diff options
author | Jason Merrill <jason@redhat.com> | 2009-12-22 18:16:38 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-12-22 18:16:38 -0500 |
commit | 5666bb32d1861b6622a2f98b5e26fa7c8e3a310f (patch) | |
tree | afb8874005dbd420c06d698d50141343ba8de761 /gcc | |
parent | e19977d3790a900d90b30fb2bf0bab3ff8a57d9a (diff) | |
download | gcc-5666bb32d1861b6622a2f98b5e26fa7c8e3a310f.zip gcc-5666bb32d1861b6622a2f98b5e26fa7c8e3a310f.tar.gz gcc-5666bb32d1861b6622a2f98b5e26fa7c8e3a310f.tar.bz2 |
re PR c++/42331 (ICE with invalid array initializer)
PR c++/42331
* typeck.c (cp_build_modify_expr): Fix thinko.
From-SVN: r155410
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/initlist29.C | 14 |
4 files changed, 28 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ed0aeeb..b75e38a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> * mangle.c (write_member_name): Move abi-version=1 code back to... diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 402f9e4..f17d9c5 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6455,15 +6455,15 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, { 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; - rhs = digest_init (lhstype, rhs); + newrhs = digest_init (lhstype, newrhs); } 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) error ("incompatible types in assignment of %qT to %qT", diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9cf74ee..cfd4b5e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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> PR target/41605 diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist29.C b/gcc/testsuite/g++.dg/cpp0x/initlist29.C new file mode 100644 index 0000000..1568678 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/initlist29.C @@ -0,0 +1,14 @@ +// 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); |