aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2023-12-12 18:07:28 -0500
committerJason Merrill <jason@redhat.com>2024-05-01 14:59:26 -0400
commita12cae973900f118436ef85c1197e91bf0428280 (patch)
tree77887bf5d629fa2afe7305845640bcbb8a61d216 /gcc/cp/cp-tree.h
parent76ca6e1f8b1524b82a871ce29cf58c79e5e77e2b (diff)
downloadgcc-a12cae973900f118436ef85c1197e91bf0428280.zip
gcc-a12cae973900f118436ef85c1197e91bf0428280.tar.gz
gcc-a12cae973900f118436ef85c1197e91bf0428280.tar.bz2
c++: drop in-charge for dtors without vbases
Constructors and destructors use the in-charge parameter to decide whether they're responsible for recursing into virtual bases. Historically all destructors had this parameter in order to also distinguish the deleting destructor. But r151673 in GCC 4.5 changed the deleting destructor to just call the complete destructor and then operator delete, making the in-charge parameter no longer relevant for destructors in classes without virtual bases. Having it causes confusion in constexpr evaluation, which assumes that clones will have the same parameters as the cloned 'tor. gcc/cp/ChangeLog: * cp-tree.h (base_ctor_identifier): Adjust comment. * call.cc (in_charge_arg_for_name): Abort on deleting dtor. * decl2.cc (maybe_retrofit_in_chrg): Don't add it for destructors without vbases, either. * constexpr.cc (cxx_eval_call_expression): Remove workaround. gcc/testsuite/ChangeLog: * g++.dg/debug/dwarf2/array-3.C: No more 'int' for in-chrg parm. * g++.dg/debug/dwarf2/array-4.C: Likewise.
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 1938ada..5d1bd6b 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -289,8 +289,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
/* The name of a constructor that does not construct virtual base classes. */
#define base_ctor_identifier cp_global_trees[CPTI_BASE_CTOR_IDENTIFIER]
/* The name of a destructor that takes an in-charge parameter to
- decide whether or not to destroy virtual base classes and whether
- or not to delete the object. */
+ decide whether or not to destroy virtual base classes. */
#define dtor_identifier cp_global_trees[CPTI_DTOR_IDENTIFIER]
/* The name of a destructor that destroys virtual base classes. */
#define complete_dtor_identifier cp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER]