mixin template, extern(C/Windows) and mangled name

Domain via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 31 20:08:30 PDT 2017


I known there is a bug with extern(C) in mixin template: 
https://issues.dlang.org/show_bug.cgi?id=12575

And I can see SimpleDllMain in core.sys.windows.dll, the mangled 
name is correct: DllMain
But my mixin template has wrong mangled name:

mixin template GetMetaData()
{
     extern(Windows) MetaData GetMetaData()
     {
         return MetaData();
     }
}

mixin GetMetaData;

I can see the mangled name is:
_D3app8__mixin911GetMetaDataWZS4zero7plugins8metadata8MetaData



More information about the Digitalmars-d-learn mailing list