digitalmars.D.bugs - [Issue 20082] New: Struct with extern destructor that's never called
- d-bugmail puremagic.com (32/32) Jul 25 2019 https://issues.dlang.org/show_bug.cgi?id=20082
https://issues.dlang.org/show_bug.cgi?id=20082 Issue ID: 20082 Summary: Struct with extern destructor that's never called causes link error Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: major Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: turkeyman gmail.com test.d ------ struct S { ~this(); } ------ Compile with windows DMD, eg: dmd -m64 -main test.d Get: test.obj : error LNK2001: unresolved external symbol _D4test1S6__dtorMFZv test.exe : fatal error LNK1120: 1 unresolved externals If build `-m32`, no problem. If you change `~this()` to `this(int)`, no problem. If you change `~this()` to `void fun()`, no problem. Something special about the destructor causes this link error, even though the function is never referenced. This is blocking std::string, std::vector, it's impossible to build druntime. --
Jul 25 2019