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

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()
Test.o: In function `_Dmain':
Test.d:(.text._Dmain+0x4): undefined reference to
collect2: ld returned 1 exit status
--- errorlevel 1

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to