This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question w.r.t. `'class Foo' has virtual functions but non-virtual destructor` warning.
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Karel Gardas <kgardas at objectsecurity dot com>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: 04 Mar 2005 14:57:13 -0500
- Subject: Re: Question w.r.t. `'class Foo' has virtual functions but non-virtual destructor` warning.
- References: <Pine.LNX.4.43.0503041543280.10054-100000@thinkpad.gardas.net>
Karel Gardas <kgardas@objectsecurity.com> writes:
> [...]
> class Foo
> {
> public:
> virtual unsigned short
> iiop_version() const = 0;
> };
>
> and when I compile it, GCC emits warning from subject, although this class
> is really abstract and will never be instantiated. [...]
I guess GCC assumes that some instances of a derived class will
eventually exist, and will be dealt with via a Foo* abstract pointer.
Is it common to never attempt to delete it via that Foo* value (which
would require a virtual destructor)?
- FChE