https://issues.dlang.org/show_bug.cgi?id=18955

--- Comment #3 from Manu <turkey...@gmail.com> ---
I'm sorry. I think I must have cut&paste fail-ed. Remove the `Alloc` arg:
-------------------------------
extern (C++, std)
{
        struct char_traits(Char)
        {
        }
        extern (C++, class) struct basic_string(T, Traits)
        {
        }
        alias test_string = basic_string!(char, char_traits!char);
}
extern (C++) void test(ref const(std.test_string) str) {}
pragma(msg, test.mangleof);
-------------------------------

Compile that, it will emit:
  ?test@@YAXAEBV?$basic_string@DV?$char_traits@D@std@@@std@@@Z
But it should emit:
  ?test@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@@std@@@Z

Notice the 'V?$char_traits' (class) should be a 'U?$char_traits' (struct);
char_traits is a struct.

If you add:
    extern (C++, struct) struct char_traits(Char)

ie, tell it explicitly to mangle the struct as a struct, it mangles correctly.
Of course, a struct should mangle as a struct naturally though.

--

Reply via email to