template mixin function name mangling

John Colvin john.loughran.colvin at gmail.com
Sun Apr 21 14:43:02 PDT 2013


Apologies for another question so short after the previous one.

tempmix.d:

mixin template Foo()
{
     extern(C) void foo() {}
}

mixin Foo!();

extern(C) void bar() {}


$dmd -c tempmix.d
$nm tempmix.o
0000000000000000 t
0000000000000000 T bar
0000000000000000 D _D7tempmix12__ModuleInfoZ
0000000000000000 T _D7tempmix15__unittest_failFiZv
0000000000000000 T _D7tempmix7__arrayZ
0000000000000000 T _D7tempmix8__assertFiZv
0000000000000000 W _D7tempmix8__T3FooZ3fooUZv
                  U _d_array_bounds
                  U _d_assertm
                  w _d_dso_registry
                  U _Dmodule_ref
                  U _d_unittestm

foo gets mangled D-style, bar is left bare. Is this deliberate? I 
was under the impression that they should both be left bare.

I tried moving the extern(C) around to various other places, 
including extern(C): at the top of the file. No success.


More information about the Digitalmars-d mailing list