https://issues.dlang.org/show_bug.cgi?id=20082
--- Comment #8 from Rainer Schuetze <[email protected]> --- > What's the workaround? If you can assume that the dtor is supplied as soon as you actually use the struct, this could work on Windows: struct S { ~this(); } void dummyDtor() { // dtor not linked in! assert(false); } pragma(linkerDirective, "/ALTERNATENAME:" ~ S.__dtor.mangleof ~ "=" ~ dummyDtor.mangleof); IIRC there is some other way on Posix to get weak linkage. --
