This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]