On Friday 04 March 2005 15:51, Karel Gardas wrote:
> 
> Hello,
> 
> I would like to ask if the behaviour of GCC 4.0.0 20050301 is correct or
> not. I have for example abstract base class like:
> 
> class Foo
> {
> public:
>     virtual unsigned short
>     iiop_version() const = 0;
> };

hi Karel,

imho if you use virtual functions you are going to derive other classes from 
Foo.

so you should (must) provide a virtual ~Foo();

so if your derived class will be deleted all the desctructors down to base 
class are found and
executed.

so imho, gcc does the right thing here to complain about the code.

regards
marcel

 
> and when I compile it, GCC emits warning from subject, although this class
> is really abstract and will never be instantiated. It's quite easy to add
> virtual dtor there, but I'm reluctant to do so, since IMHO GCC should
> check if the class is abstract or not, so I would like to ask if I should
> fill a bugreport or correct my code.
> 

Attachment: pgpNPQY8TDGkw.pgp
Description: PGP signature

Reply via email to