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

--- Comment #1 from yebblies <[email protected]> ---

This struct is passed in registers by dmd, while dmc++ (and presumably msvc)
returns it on the stack, causing crash.  Adding a dtor 'fixes' it.

struct Prot
{
    int kind;
    void *pkg;
    extern(D) this(int kind)
    {
        this.kind = kind;
        this.pkg = null;
    }
    // ~this()
    // {
    // }
}

extern(C++) Prot func();

void main()
{
    auto p = func();
}

--

Reply via email to