This is the mail archive of the
mailing list for the GCC project.
Re: Subtle problem with virtual keyword that can mislead the unwary...
- To: montanaro at crd dot GE dot COM, egcs-bugs at cygnus dot com
- Subject: Re: Subtle problem with virtual keyword that can mislead the unwary...
- From: Jason Merrill <jason at cygnus dot com>
- Date: 26 Mar 1998 09:47:16 -0800
- References: <199803252100.QAA00990.email@example.com>
>>>>> Skip Montanaro <montanaro@crd.GE.COM> writes:
> Now, I suspect all the C++ experts reading this are way ahead of me,
> thinking, "The problem's obvious. He forgot to declare B's destructor
> virtual." Sure enough, adding the "virtual" keyword to the
> declaration of B::~B() cures the error.
Um, no. The problem is that you didn't define ~B. It is automatically
virtual because ~A is.