digitalmars.D.bugs - [Issue 18896] New: extern(C++) template with class argument mangling
- d-bugmail puremagic.com (32/32) May 23 2018 https://issues.dlang.org/show_bug.cgi?id=18896
https://issues.dlang.org/show_bug.cgi?id=18896 Issue ID: 18896 Summary: extern(C++) template with class argument mangling Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: turkeyman gmail.com C++: --------------------------------------- class C {}; template <typename T> void create(T** x); --------------------------------------- D: --------------------------------------- extern(C++): class C {} void create(T)(T* x); --------------------------------------- Trouble is; in CPP, the template mangles as a C, but in D, the class mangles as C*... so the mangling doesn't match. `template<typename Class>` is an unbelievably common occurrence in C++... but how do we express a signature that mangles correctly in D? D always mangles `Class` as `Class*`... which changes the signature. We really need to offer a solution here, this is a gaping hole! --
May 23 2018