diff options
author | Jason Merrill <jason@redhat.com> | 2013-04-25 16:25:04 +0000 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2013-04-25 16:25:04 +0000 |
commit | 56c245329a2e304e36912aa7fd7ce01b044a61cf (patch) | |
tree | b4618d1d70211f0478dcc38b99a00da0e4a152a5 /gcc/cp | |
parent | d7d99b5a3474ee65739e336c594e1ac5f92c6ad2 (diff) |
PR c++/50261
* init.c (perform_member_init): Call reshape_init.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@198312 138bc75d-0d04-0410-961f-82ee72b054a4
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 9852bd52589..8f404106f81 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 Paolo Carlini <paolo.carlini@oracle.com> PR c++/56970 diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 11006b33f89..a0efbbce452 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 |