https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109172
--- Comment #6 from Mike Smith <MikeSmith32564 at mail dot com> --- (In reply to CVS Commits from comment #4) > The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: > > https://gcc.gnu.org/g:890043314a7f405081990ea9d0cb577dd44f883f > > commit r13-6742-g890043314a7f405081990ea9d0cb577dd44f883f > Author: Jason Merrill <ja...@redhat.com> > Date: Fri Mar 17 15:27:10 2023 -0400 > > c++: throw and private destructor [PR109172] > > Since we aren't going through the normal call machinery, we need to check > the dtor access specifically. > > PR c++/109172 > > gcc/cp/ChangeLog: > > * except.cc (build_throw): Check dtor access. > > gcc/testsuite/ChangeLog: > > * g++.dg/eh/dtor4.C: New test. Thank you for addressing this quickly, I don't know if backporting will be necessary, About the test written in dtor4.C, I don't know how testing is supposed to work, but if the goal is to confirm that this fails to compile and link, linking will fail due to a missing implementation, and since now, compiling will fail due to the private destructor, so no matter what this will fail to build, shouldn't the body of the destructor here be defined like ~Demo() { } this?