diff options
author | Jason Merrill <jason@redhat.com> | 2013-04-25 12:24:33 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-04-25 12:24:33 -0400 |
commit | 4794d4b5fe27bd40d4fa11ce8319143cf4d259c2 (patch) | |
tree | 4b7fc95ec96b3368f6b969a9d7585d1fae0c9b9c /gcc/cp | |
parent | ea28bb0b9da3f70832bb599b298f2ae019b83a15 (diff) | |
download | gcc-4794d4b5fe27bd40d4fa11ce8319143cf4d259c2.zip gcc-4794d4b5fe27bd40d4fa11ce8319143cf4d259c2.tar.gz gcc-4794d4b5fe27bd40d4fa11ce8319143cf4d259c2.tar.bz2 |
re PR c++/50261 ([C++0x] ICE on brace-initialize an array member)
PR c++/50261
* init.c (perform_member_init): Call reshape_init.
From-SVN: r198309
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/init.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 770f24a..a1471dd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-25 Jason Merrill <jason@redhat.com> + + PR c++/50261 + * init.c (perform_member_init): Call reshape_init. + 2013-04-24 Jason Merrill <jason@redhat.com> PR c++/53721 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 28e2555..3587b08 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -634,7 +634,12 @@ perform_member_init (tree member, tree init) init = build_x_compound_expr_from_list (init, ELK_MEM_INIT, tf_warning_or_error); if (TREE_TYPE (init) != type) - init = digest_init (type, init, tf_warning_or_error); + { + if (BRACE_ENCLOSED_INITIALIZER_P (init) + && CP_AGGREGATE_TYPE_P (type)) + init = reshape_init (type, init, tf_warning_or_error); + init = digest_init (type, init, tf_warning_or_error); + } if (init == error_mark_node) return; /* A FIELD_DECL doesn't really have a suitable lifetime, but |