]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: __is_destructible fixes [PR107600]
authorJason Merrill <jason@redhat.com>
Mon, 2 Jun 2025 14:09:07 +0000 (10:09 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 2 Jun 2025 15:28:23 +0000 (11:28 -0400)
commitd7f33a35bffe7b331b0f8475e52c2dcc1c5d2ea8
treee20362ac72d5a1725860538157054e182ff91a85
parent8a42538f9693a6608bb733860adec75a691f1940
c++: __is_destructible fixes [PR107600]

destructible_expr was wrongly assuming that TO is a class type.

When is_xible_helper was added in r8-742 it returned early for abstract
class types, which is correct for __is_constructible, but not
__is_assignable or (now) __is_destructible.

PR c++/107600

gcc/cp/ChangeLog:

* method.cc (destructible_expr): Handle non-classes.
(constructible_expr): Check for abstract class here...
(is_xible_helper): ...not here.

gcc/testsuite/ChangeLog:

* g++.dg/ext/is_destructible2.C: New test.
gcc/cp/method.cc
gcc/testsuite/g++.dg/ext/is_destructible2.C [new file with mode: 0644]