Bug 20423 – di generator does not emit nothrow on dtors

Status
NEW
Severity
blocker
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-12-01T15:30:16Z
Last change time
2024-12-13T19:06:19Z
Assigned to
No Owner
Creator
zopsicle
Moved to GitHub: dmd#19644 →

Comments

Comment #0 by zopsicle — 2019-12-01T15:30:16Z
When a struct dtor is marked nothrow then the interface file generated with -H disagrees with the mangled name in the object file created with -c: ``` $ cat foo.d module foo; struct S { nothrow ~this() {} } $ dmd -H -c foo.d $ cat foo.di // D import file generated from 'foo.d' module foo; struct S { ~this(); } $ nm foo.o | grep __dtor 0000000000000000 T _D3foo1S6__dtorMFNbZv ``` This causes linker errors: ``` $ cat bar.d module bar; import foo; void main() { auto s = S(); } $ dmd bar.d foo.di foo.o bar.o:bar.d:function _Dmain: error: undefined reference to '_D3foo1S6__dtorMFZv' ``` Difference between symbols: ``` .o: _D3foo1S6__dtorMFNbZv .di: _D3foo1S6__dtorMFZv ``` Verified with: - DMD64 D Compiler v2.085.1 - LDC 1.16.0 based on DMD v2.086.1 and LLVM 8.0.1
Comment #1 by robert.schadek — 2024-12-13T19:06:19Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19644 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB