http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51620
Bug #: 51620 Summary: [c++0x] [4.6/4.7 Regression] ICE with private destructor Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: reich...@gcc.gnu.org The following invalid code snippet triggers an ICE since GCC 4.6.0 when compiled with "-std=c++0x": =========================== template<int> class A { virtual ~A(); }; struct B : A<0>, A<1> { B() {} }; =========================== bug.cc:6:8: error: deleted function 'virtual B::~B()' bug.cc:3:11: error: overriding non-deleted function 'A<<anonymous> >::~A() [with int <anonymous> = 0]' bug.cc:6:8: note: 'virtual B::~B()' is implicitly deleted because the default definition would be ill-formed: bug.cc:3:11: error: 'A<<anonymous> >::~A() [with int <anonymous> = 0]' is private bug.cc:6:8: error: within this context bug.cc:3:11: error: 'A<<anonymous> >::~A() [with int <anonymous> = 1]' is private bug.cc:6:8: error: within this context bug.cc:6:8: error: deleted function 'virtual B::~B()' bug.cc:3:11: error: overriding non-deleted function 'A<<anonymous> >::~A() [with int <anonymous> = 1]' bug.cc: In constructor 'B::B()': bug.cc:3:11: error: 'A<<anonymous> >::~A() [with int <anonymous> = 0]' is private bug.cc:8:7: error: within this context bug.cc:3:11: error: 'A<<anonymous> >::~A() [with int <anonymous> = 1]' is private bug.cc:8:7: error: within this context bug.cc: At global scope: bug.cc:9:2: error: use of deleted function 'virtual B::~B()' bug.cc:9:2: error: use of deleted function 'virtual B::~B()' bug.cc:9:2: error: use of deleted function 'virtual B::~B()' bug.cc:9:2: error: use of deleted function 'void B::_ZThn4_N1BD1Ev()' bug.cc:6:8: note: 'void B::_ZThn4_N1BD1Ev()' is implicitly deleted because the default definition would be ill-formed: bug.cc:6:8: internal compiler error: in synthesized_method_walk, at cp/method.c:1168 Please submit a full bug report, [etc.] In addition, the first part of the message is duplicated, "use of deleted function 'virtual B::~B()'" appears 3 times, and "B::_ZThn4_N1BD1Ev()" is not very meaningful to the user.