struct N { private: virtual ~N (); }; N * foo () { return new N (); }
used to compile until http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=138355 Does it really need to have an accessible destructor if it is never deleted? Dodji cited [basic.life]/4 which could mean this is valid. Distilled from thunderbird. -- Summary: [4.4 Regression] Accessible constructor required for new Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39109