[Issue 3211] New: Template mix-ins silently drop LinkageAttribute(s)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 26 04:03:43 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3211

           Summary: Template mix-ins silently drop LinkageAttribute(s)
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: All
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: komadori at gekkou.co.uk


When a template is mixed-in, any LinkageAttribute(s) on functions inside its
body are silently dropped. I believe this should not be the case.

Reproduced with DMD 1.046 under Linux and LDC r1522 under Solaris. Test case
and compiler output below:
...
module Test;

template Test(char[] N)
{
  mixin("extern (C) void "~N~"();");  
}

mixin Test!("abort");

// Using a string mix-in directly works fine:
//   mixin("extern (C) void abort();");

void main()
{
  abort();
}
---
Test.o: In function `_Dmain':
Test.d:(.text._Dmain+0x4): undefined reference to
`_D4Test26__T4TestVG5aa5_61626f7274Z5abortUZv'
collect2: ld returned 1 exit status
--- errorlevel 1

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list