atilaneves / dpp

Directly include C headers in D source code
Boost Software License 1.0
230 stars 31 forks source link

still a bug in templated opAssign, opCall and maybe other operators #114

Closed Laeeth closed 5 years ago

Laeeth commented 5 years ago
--- test.dpp
#include "test.hpp"
--- test.hpp
template<class T>
struct Foo
{
    template<class U>
    Foo& operator=(U& other)
    {
        return *this;
    }
};
--- test.d.bad_extract.txt
extern(C++)
{
    struct Foo(T)
    {
    private:
        extern(D) ref Foo!(T) opAssign()(U)(ref U arg0) @nogc nothrow
        {
            return opCppAssign(arg0);
        }
        ref Foo!(T) opCppAssign(U)(ref U) @nogc nothrow;
    }
}

The following line:

extern(D) ref Foo!(T) opAssign()(U)(ref U arg0) @nogc nothrow

should be:

extern(D) ref Foo!(T) opAssign(U)(ref U arg0) @nogc nothrow