Question w.r.t. `'class Foo' has virtual functions but non-virtual destructor` warning.

Frank Ch. Eigler fche@redhat.com
Fri Mar 4 19:57:00 GMT 2005


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



More information about the Gcc mailing list