diff options
author | Jason Merrill <jason@redhat.com> | 2011-10-20 15:13:51 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-10-20 15:13:51 -0400 |
commit | 76187e874a402294a0d34fc982da0b279f1ad2a9 (patch) | |
tree | 484117a5122d349a2fcd02304ec0dde61772dd4d /gcc/cp | |
parent | 5dea5b2a34ca9f7feb347721f8817007e082d391 (diff) | |
download | gcc-76187e874a402294a0d34fc982da0b279f1ad2a9.zip gcc-76187e874a402294a0d34fc982da0b279f1ad2a9.tar.gz gcc-76187e874a402294a0d34fc982da0b279f1ad2a9.tar.bz2 |
re PR c++/41449 (Partial aggregate initialization not cleaned up on exception)
PR c++/41449
* typeck2.c (split_nonconstant_init_1): Handle EH cleanup of
initialized subobjects.
From-SVN: r180267
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a32a7b9..df7e1bc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-10-20 Jason Merrill <jason@redhat.com> + + PR c++/41449 + * typeck2.c (split_nonconstant_init_1): Handle EH cleanup of + initialized subobjects. + 2011-10-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/13657 diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 3accab6..580f669 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -567,6 +567,13 @@ split_nonconstant_init_1 (tree dest, tree init) code = build2 (INIT_EXPR, inner_type, sub, value); code = build_stmt (input_location, EXPR_STMT, code); add_stmt (code); + if (!TYPE_HAS_TRIVIAL_DESTRUCTOR (inner_type)) + { + code = (build_special_member_call + (sub, complete_dtor_identifier, NULL, inner_type, + LOOKUP_NORMAL, tf_warning_or_error)); + finish_eh_cleanup (code); + } num_split_elts++; } |