Bug 16687 – Win COFF: Duplicate COMDAT on overloaded templated function

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2016-11-15T02:33:33Z
Last change time
2024-12-13T18:50:40Z
Assigned to
No Owner
Creator
Jesse Phillips
Moved to GitHub: dmd#19206 →

Comments

Comment #0 by Jesse.K.Phillips+D — 2016-11-15T02:33:33Z
This code results in the following MS linker message: test.obj : fatal error LNK1179: invalid or corrupt file: duplicate COMDAT '_D4test8__T1STwZ1S1fMFNaNbNiNfwZv' Error: linker exited with status 43694744 ------------------ void main() { S!dchar a4; } struct S(T) { void f(T value) { } void f(dchar c) { } } ------------------------- Obviously when the template is generated f(T)() is f(dchar), optlink doesn't complain but I don't know what is correct. Possibly similar: https://issues.dlang.org/show_bug.cgi?id=11081 https://issues.dlang.org/show_bug.cgi?id=14541
Comment #1 by bugzilla — 2017-10-24T22:34:50Z
Optlink doesn't complain because when there are multiple COMDATs with the same name, the linker just picks one.
Comment #2 by bugzilla — 2017-10-24T22:40:33Z
*** Issue 17332 has been marked as a duplicate of this issue. ***
Comment #3 by nick — 2024-08-31T11:19:43Z
Comment #4 by robert.schadek — 2024-12-13T18:50:40Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19206 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB