public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51620] New: [c++0x] [4.6/4.7 Regression] ICE with private destructor
@ 2011-12-19  7:23 reichelt at gcc dot gnu.org
  2011-12-19  7:36 ` [Bug c++/51620] " reichelt at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2011-12-19  7:23 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: reichelt@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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-01-19 21:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-19  7:23 [Bug c++/51620] New: [c++0x] [4.6/4.7 Regression] ICE with private destructor reichelt at gcc dot gnu.org
2011-12-19  7:36 ` [Bug c++/51620] " reichelt at gcc dot gnu.org
2011-12-19  9:48 ` jakub at gcc dot gnu.org
2011-12-30  6:15 ` pinskia at gcc dot gnu.org
2012-01-13  5:13 ` jason at gcc dot gnu.org
2012-01-13 15:52 ` jason at gcc dot gnu.org
2012-01-13 15:57 ` jason at gcc dot gnu.org
2022-01-12  2:34 ` cvs-commit at gcc dot gnu.org
2022-01-19 19:49 ` cvs-commit at gcc dot gnu.org
2022-01-19 21:21 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).