Re: extern(C++) classes; dtor must go in vtable

2018-05-22 Thread Steven Schveighoffer via Digitalmars-d
On 5/22/18 12:57 AM, Manu wrote: On 21 May 2018 at 15:39, Steven Schveighoffer via Digitalmars-d wrote: On 5/21/18 6:26 PM, Manu wrote: On 21 May 2018 at 14:53, Jonathan M Davis via Digitalmars-d wrote: On Monday, May 21, 2018 14:33:44 Manu via Digitalmars-d wrote: How do virtual destruc

Re: extern(C++) classes; dtor must go in vtable

2018-05-21 Thread Manu via Digitalmars-d
On 21 May 2018 at 15:39, Steven Schveighoffer via Digitalmars-d wrote: > On 5/21/18 6:26 PM, Manu wrote: >> >> On 21 May 2018 at 14:53, Jonathan M Davis via Digitalmars-d >> wrote: >>> >>> On Monday, May 21, 2018 14:33:44 Manu via Digitalmars-d wrote: How do virtual destructors work in

Re: extern(C++) classes; dtor must go in vtable

2018-05-21 Thread Steven Schveighoffer via Digitalmars-d
On 5/21/18 6:26 PM, Manu wrote: On 21 May 2018 at 14:53, Jonathan M Davis via Digitalmars-d wrote: On Monday, May 21, 2018 14:33:44 Manu via Digitalmars-d wrote: How do virtual destructors work in normal D classes? It is my understanding that destructors in D are never virtual but rather tha

Re: extern(C++) classes; dtor must go in vtable

2018-05-21 Thread Manu via Digitalmars-d
On 21 May 2018 at 15:03, Jonathan M Davis via Digitalmars-d wrote: > On Monday, May 21, 2018 14:33:44 Manu via Digitalmars-d wrote: >> extern(C++) classes. >> >> Currently, we don't add destructors to the vtable... we suggest that >> users need to create some dummy virtual functions to fill those

Re: extern(C++) classes; dtor must go in vtable

2018-05-21 Thread Manu via Digitalmars-d
On 21 May 2018 at 14:53, Jonathan M Davis via Digitalmars-d wrote: > On Monday, May 21, 2018 14:33:44 Manu via Digitalmars-d wrote: >> How do virtual destructors work in normal D classes? > > It is my understanding that destructors in D are never virtual but rather > that the runtime handles calli

Re: extern(C++) classes; dtor must go in vtable

2018-05-21 Thread Jonathan M Davis via Digitalmars-d
On Monday, May 21, 2018 14:33:44 Manu via Digitalmars-d wrote: > extern(C++) classes. > > Currently, we don't add destructors to the vtable... we suggest that > users need to create some dummy virtual functions to fill those vtable > slots so that the vtable layout otherwise matches the C++ class.

Re: extern(C++) classes; dtor must go in vtable

2018-05-21 Thread Jonathan M Davis via Digitalmars-d
On Monday, May 21, 2018 14:33:44 Manu via Digitalmars-d wrote: > How do virtual destructors work in normal D classes? It is my understanding that destructors in D are never virtual but rather that the runtime handles calling them correctly. IIRC, that relates to some of the issues that make it so

extern(C++) classes; dtor must go in vtable

2018-05-21 Thread Manu via Digitalmars-d
extern(C++) classes. Currently, we don't add destructors to the vtable... we suggest that users need to create some dummy virtual functions to fill those vtable slots so that the vtable layout otherwise matches the C++ class. This leaves us in a position where destruction doesn't work for polymor