[Issue 1467] New: mixin same templates cause ld error: multiple definition

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 2 06:30:23 PDT 2007


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 at digitalmars.com
        ReportedBy: redsea at 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


-- 



More information about the Digitalmars-d-bugs mailing list