[Issue 19260] extern(C++) `T* const` mangling

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 23 11:21:24 UTC 2018


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

kinke at gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke at gmx.net

--- Comment #1 from kinke at gmx.net ---
Patching the mangle at compile-time like this (MSVC only) might work:

extern(C++) template deallocate(T)
{
    void _deallocate(T* ptr, size_t count);

    private extern(D) string getMangle()
    {
        import std.array;
        return _deallocate.mangleof.replace("PEAU", "QEAU");
    }

    pragma(mangle, getMangle())
    void deallocate(T* ptr, size_t count);
}

D:   https://run.dlang.io/is/q4kF2e
C++: https://godbolt.org/z/GpXfqV

--


More information about the Digitalmars-d-bugs mailing list