September 02, 2007 [Issue 1467] New: mixin same templates cause ld error: multiple definition | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=1467 Summary: mixin same templates cause ld error: multiple definition Product: D Version: 1.020 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: redsea@163.com 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 -- |
Copyright © 1999-2021 by the D Language Foundation