Bug 1467 – mixin same templates cause ld error: multiple definition

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2007-09-02T08:30:22Z
Last change time
2019-07-23T16:13:01Z
Keywords
link-failure
Assigned to
No Owner
Creator
Haitong Xiao

Comments

Comment #0 by redsea — 2007-09-02T08:30:22Z
code: ------------ class C1(alias t1, alias t2) { mixin t1!(); class C2 { mixin t2!(); } } struct S1() { int i; } void main() { C1!(S1, S1) v; } ------------ dmd 1.018 & 1.020 gave same ld error message. dmd 1.018 within dsss(tango) compile result: dsss_objs/_test.o:(.gnu.linkonce.d._D4test7__T2S1Z2S16__initZ+0x0): multiple definition of `_D4test7__T2S1Z2S16__initZ' dsss_objs/_test.o:(.gnu.linkonce.d._D4test7__T2S1Z2S16__initZ+0x0): first defined here collect2: ld returned 1 exit status standalone dmd 1.020 compile result: test.o:(.gnu.linkonce.d._D4test7__T2S1Z2S16__initZ+0x0): multiple definition of `_D4test7__T2S1Z2S16__initZ' test.o:(.gnu.linkonce.d._D4test7__T2S1Z2S16__initZ+0x0): first defined here
Comment #1 by razvan.nitu1305 — 2019-07-23T16:13:01Z
This example compiles and runs fine in D2. Closing as WONTFIX.