diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-11-17 07:59:13 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-11-17 07:59:13 +0100 |
commit | 84526801f6392b100892c7d4276176174114421f (patch) | |
tree | b11e910e87ac7c6407c523f47b7c6dada78f1a4b /gcc/cp | |
parent | 5a887be717cd21d8be05c48c62405ede20b6ca75 (diff) | |
download | gcc-84526801f6392b100892c7d4276176174114421f.zip gcc-84526801f6392b100892c7d4276176174114421f.tar.gz gcc-84526801f6392b100892c7d4276176174114421f.tar.bz2 |
re PR c++/42059 ([c++0x] ICE with initializer list for VLA)
PR c++/42059
* typeck.c (cp_build_modify_expr): For initializer list call
check_array_initializer to make sure lhs isn't a VLA.
* g++.dg/cpp0x/initlist26.C: New test.
From-SVN: r154237
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 07175a9..d1db746 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-11-17 Jakub Jelinek <jakub@redhat.com> + + PR c++/42059 + * typeck.c (cp_build_modify_expr): For initializer list call + check_array_initializer to make sure lhs isn't a VLA. + 2009-11-16 Jason Merrill <jason@redhat.com> PR c++/189, c++/9937, c++/13950, DR 176 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index de21c43..3a95259 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -6239,7 +6239,11 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, int from_array; if (BRACE_ENCLOSED_INITIALIZER_P (rhs)) - rhs = digest_init (lhstype, rhs); + { + if (check_array_initializer (lhs, lhstype, rhs)) + return error_mark_node; + rhs = digest_init (lhstype, rhs); + } else if (!same_or_base_type_p (TYPE_MAIN_VARIANT (lhstype), TYPE_MAIN_VARIANT (TREE_TYPE (rhs)))) |