diff options
author | Jason Merrill <jason@redhat.com> | 2013-10-23 14:08:56 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-10-23 14:08:56 -0400 |
commit | eca7fc5755041ad90a7db18bbd6b3294f5075da7 (patch) | |
tree | 42c2ea99646dafa555892877e4e1670084770361 /gcc/cp/call.c | |
parent | d4c579b56109284162f084bf031cd4eea1f1b036 (diff) | |
download | gcc-eca7fc5755041ad90a7db18bbd6b3294f5075da7.zip gcc-eca7fc5755041ad90a7db18bbd6b3294f5075da7.tar.gz gcc-eca7fc5755041ad90a7db18bbd6b3294f5075da7.tar.bz2 |
In C++11 a trivial [cd]tor might not be callable.
* class.c (user_provided_p): A function deleted on its declation
in the class is not user-provided.
(type_build_ctor_call): Also force a ctor call if we
might have a deleted or private trivial ctor.
(type_build_dtor_call): New.
(deduce_noexcept_on_destructors): Remove obsolete code.
* cp-tree.h: Declare type_build_dtor_call.
* decl.c (expand_static_init): Make sure trivial dtors are callable.
(cxx_maybe_build_cleanup): Likewise.
* except.c (build_throw): Likewise.
* init.c (build_value_init): Handle trivial but not callable ctors.
(perform_target_ctor): Make sure trivial dtor is callable.
(perform_member_init): Likewise.
(expand_cleanup_for_base): Likewise.
(build_vec_delete_1): Likewise.
(build_delete): Likewise.
(push_base_cleanups): Likewise.
(build_new_1): Avoid redundant error.
* method.c (synthesized_method_walk): Can't ever exit early in C++11.
Always process the subobject destructor.
* semantics.c (finish_compound_literal): Make sure trivial dtor is
callable.
* typeck2.c (split_nonconstant_init): Likewise.
From-SVN: r203985
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 3ed73b8..cd90140 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -9273,6 +9273,9 @@ set_up_extended_ref_temp (tree decl, tree expr, vec<tree, va_gc> **cleanups, static_aggregates = tree_cons (NULL_TREE, var, static_aggregates); } + else + /* Check whether the dtor is callable. */ + cxx_maybe_build_cleanup (var, tf_warning_or_error); } *initp = init; |