https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107352
Bug ID: 107352 Summary: polymorphic class with destroying delete operator defined causes internal compiler error Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: justus at opentransactions dot org Target Milestone: --- Created attachment 53746 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53746&action=edit build errors Defining a std::destroying_delete_t operator delete for a polymorphic class causes GCC to fail with "internal compiler error: in build_if_in_charge, at cp/class.cc:229" I've tested with 10.3, 11.3, and 12.2 and all of them have the same issue. The project both builds and passes tests successfully when compiled with clang and the problem also goes away if I remove the destroying delete operator and put the code that was in that function at all the places where it would have been called.