https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79424
Bug ID: 79424 Summary: dtor synthesized before abstractness correctly determined Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nathan at gcc dot gnu.org Target Milestone: --- Created attachment 40694 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40694&action=edit Exemplar I stumbled upon this looking at 79393. In the example, we think A2::~A2 is deleted because we haven't yet determined it's abstractness. Consequently we think we need VDT::~VDT, which is private. Then we give an error about overriding non-deleted A1::~A1 with a deleted function. Further fallout when the cleanup for global a3 attempts to use deleted A3::~A3 (which is deleted because A2::~A2 was erroneously deleted). dfs_declare_virt_assop_and_dtor calls lazily_declare_fn (sfk_destructor, t) before CLASSTYPE_PURE_VIRTUALS is determined (we've not looked at inherited pure virts, nor local overriders for such inherited pure virts. It only contains the pure virts declared in the class). That's from check_bases_and_members called early in from finish_struct_1. Pure virtuals are finally determined from finish_struct_bits called much later in finish_struct_1.