www.digitalmars.com         C & C++   DMDScript  

D - BUG: Abstract dtors

reply "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
I'm pretty sure that I've found a bug with abstract
classes. I'm not sure what the bug really is.

I've made an abstract class with a dtor. It compiles,
but doesn't link (can't find the dtor or something).
Removing the dtor helps.

All this is a bit strange. If dtors in abstract classes are
disallowed, it must produce a compile error. If they
are allowed, well then it's a bug.

Another strange thing and the reason i discovered this;
It is allowed to 'new' objects in abstract classes. As
long as that is allowed, dtors must be allowed too.

My opinion on what should be the correct behaviour?
'new'ing objects and having dtors must be allowed.

Lars Ivar Igesund
Oct 07 2003
parent reply "Walter" <walter digitalmars.com> writes:
Can you post a small example illustrating this, please? Thanks, -Walter

"Lars Ivar Igesund" <larsivi stud.ntnu.no> wrote in message
news:blv3oo$16bj$1 digitaldaemon.com...
 I'm pretty sure that I've found a bug with abstract
 classes. I'm not sure what the bug really is.

 I've made an abstract class with a dtor. It compiles,
 but doesn't link (can't find the dtor or something).
 Removing the dtor helps.

 All this is a bit strange. If dtors in abstract classes are
 disallowed, it must produce a compile error. If they
 are allowed, well then it's a bug.

 Another strange thing and the reason i discovered this;
 It is allowed to 'new' objects in abstract classes. As
 long as that is allowed, dtors must be allowed too.

 My opinion on what should be the correct behaviour?
 'new'ing objects and having dtors must be allowed.

 Lars Ivar Igesund
Oct 08 2003
parent "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
"Walter" <walter digitalmars.com> wrote in message
news:bm0dig$2uoq$2 digitaldaemon.com...
 Can you post a small example illustrating this, please? Thanks, -Walter
Attached. Lars Ivar Igesund begin 666 dtorprob.d ` end
Oct 08 2003