diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-02-03 09:15:29 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-02-03 09:15:29 -0500 |
commit | ed2b519e02eac99fadfa51adc7b11f8854c24575 (patch) | |
tree | ce8bb184a383d8d5b228d7c220ba95b3875223aa /libgcc/enable-execute-stack-empty.c | |
parent | e7930c6750d03b28d922ebbbace20ba9d8622c6a (diff) | |
download | gcc-ed2b519e02eac99fadfa51adc7b11f8854c24575.zip gcc-ed2b519e02eac99fadfa51adc7b11f8854c24575.tar.gz gcc-ed2b519e02eac99fadfa51adc7b11f8854c24575.tar.bz2 |
c++: ICE on unviable/ambiguous constrained dtors [PR96745]
Here we're crashing from check_bases_and_members due to
CLASSTYPE_DESTRUCTOR being an OVERLOAD which, due to the pruning
performed by add_method, should only happen if there is no viable
destructor or the destructor is ambiguous because of unsatisfied
or ambiguous constraints.
This patch fixes this by making check_bases_and_members naturally handle
CLASSTYPE_DESTRUCTOR being an OVERLOAD. It's then convenient to prune
the OVERLOAD after effectively diagnosing the overload resolution
failure in check_methods.
PR c++/96745
gcc/cp/ChangeLog:
* class.cc (check_methods): Diagnose an unviable OVERLOAD
set for CLASSTYPE_DESTRUCTOR differently from an ambiguous one.
Then prune the OVERLOAD to a single function.
(check_bases_and_members): Handle CLASSTYPE_DESTRUCTOR being
an OVERLOAD when calling deduce_noexcept_on_destructor.
Document why it has to be called before check_methods.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-dtor1.C: New test.
Diffstat (limited to 'libgcc/enable-execute-stack-empty.c')
0 files changed, 0 insertions, 0 deletions