aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg
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/testsuite/g++.dg
parent76ca6e1f8b1524b82a871ce29cf58c79e5e77e2b (diff)
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/testsuite/g++.dg')
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/array-3.C6
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/array-4.C2
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/array-3.C b/gcc/testsuite/g++.dg/debug/dwarf2/array-3.C
index 8db6133b765..ae04b217e28 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/array-3.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/array-3.C
@@ -12,9 +12,9 @@ const S S::array[2] = { S(), S() };
/* Verify that we get only one DW_TAG_subrange_type (plus the abbrev),
and one DW_AT_upper_bound (non-abbrev), because the array
definition loses the readonly wrapper for the array type because of
- the dynamic initializers. The const types are 4: S, S*, int, and
- S[4], plus the abbrev. A const version of S[4] doesn't make sense,
+ the dynamic initializers. The const types are 3: S, S*, and
+ S[2], plus the abbrev. A const version of S[2] doesn't make sense,
but we output it. */
-/* { dg-final { scan-assembler-times " DW_TAG_const_type" 5 } } */
+/* { dg-final { scan-assembler-times " DW_TAG_const_type" 4 } } */
/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */
/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/array-4.C b/gcc/testsuite/g++.dg/debug/dwarf2/array-4.C
index 6b3f546c1b5..6133234181a 100644
--- a/gcc/testsuite/g++.dg/debug/dwarf2/array-4.C
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/array-4.C
@@ -11,6 +11,6 @@ const S array[2] = { S(), S() };
/* Like array-3, but with a non-member array without a separate
declaration, to check that we don't issue the nonsensical
DW_TAG_const_type used by the member array declaration there. */
-/* { dg-final { scan-assembler-times " DW_TAG_const_type" 4 } } */
+/* { dg-final { scan-assembler-times " DW_TAG_const_type" 3 } } */
/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */
/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */