extern(C++) { class Foo { } void foo(Foo); pragma(msg, foo.mangleof); } mangled to: void __cdecl foo(class Foo * __ptr64) expected (because of common C++ & STL practice): void __cdecl foo(class Foo & __ptr64)
Does extern(C++,class) struct Foo { } extern(C++) void foo(ref Foo); pragma(msg, foo.mangleof); work?
Yes, but this workaround breaks a lot of API logic on the D side.
There's no clear right or wrong here, and the proposed change would probably break a lot of code. E.g., all DMD C++ headers would need to be adapted. Additionally, a D class reference can safely be assumed to be null, while you normally don't expect null for a C++ reference. => WONTFIX IMO
Duplicate of 18896 which has a bit more specific title. *** This issue has been marked as a duplicate of issue 18896 ***