[Issue 20082] Struct with extern destructor that's never called causes link error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 25 18:17:51 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20082

kinke <kinke at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke at gmx.net

--- Comment #3 from kinke <kinke at gmx.net> ---
(In reply to Manu from comment #2)
> I suspected the TypeInfo, but shouldn't that only contain destructor for
> classes?

Nope, it's needed to implement the `destroy(void*)` method.

> In my case, the struct is extern(C++) too, which means the D TypeInfo
> shouldn't even exist?

That seems to be a common misconception. Without D TypeInfo, you'd lose the
ability to have dynamic arrays of that extern(C++) struct, associative arrays
with that struct as key type etc. etc.

--


More information about the Digitalmars-d-bugs mailing list