aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/typeck2.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-15 04:02:49 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-15 04:02:49 +0000
commit9b89ee4405f7bd48853403daa4d6159a3ded6906 (patch)
treec022add6edc574e3112a7cae9d0a261c7de1c0c1 /gcc/cp/typeck2.c
parenteb40296f6fb8d0fe539da393a1a9fb1cf5407233 (diff)
PR c++/70494
* decl.c (cxx_maybe_build_cleanup): Handle non-decls. * typeck2.c (split_nonconstant_init_1): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235003 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/typeck2.c')
-rw-r--r--gcc/cp/typeck2.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index b921689808a..e59ad51c3bd 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -688,14 +688,9 @@ split_nonconstant_init_1 (tree dest, tree init)
code = build_stmt (input_location, EXPR_STMT, code);
code = maybe_cleanup_point_expr_void (code);
add_stmt (code);
- if (type_build_dtor_call (inner_type))
- {
- code = (build_special_member_call
- (sub, complete_dtor_identifier, NULL, inner_type,
- LOOKUP_NORMAL, tf_warning_or_error));
- if (!TYPE_HAS_TRIVIAL_DESTRUCTOR (inner_type))
- finish_eh_cleanup (code);
- }
+ if (tree cleanup
+ = cxx_maybe_build_cleanup (sub, tf_warning_or_error))
+ finish_eh_cleanup (cleanup);
}
num_split_elts++;