@RazvanN7 created dlang/dmd pull request #13540 "Fix Issue 22014 - Wrong MSVC++ mangling of wchar_t" fixing this issue:
- Fix Issue 22014 - Wrong MSVC++ mangling of wchar_t
https://github.com/dlang/dmd/pull/13540
Comment #2 by elpenguino+D — 2023-12-15T05:25:00Z
this appears to be caused by dmd not recognizing wchar_t and instead mangling it as the wchar/dchar it is aliased to. from what I gather, this was intended to be fixed by an abandoned plan for 2.085.0/2.086.0 (https://github.com/dlang/dmd/pull/9029,https://github.com/dlang/dmd/pull/9130,https://github.com/dlang/druntime/pull/2390) that never came to fruition, despite its inclusion in the 2.085.0 changelog. similarly, the related -extern-std switch support never materialized...
The mangler does recognize a __c_wchar_t type, but that isn't documented or defined anywhere in dmd and requires a definition similar to `enum __c_wchar_t : wchar` or dchar in user code. unfortunately, core.stdcpp.string's basic_string won't work with this, causing std::wstring support to be just out of reach
Comment #3 by kinke — 2023-12-16T09:55:50Z
(In reply to elpenguino+D from comment #2)
> The mangler does recognize a __c_wchar_t type, but that isn't documented or
> defined anywhere in dmd and requires a definition similar to `enum
> __c_wchar_t : wchar` or dchar in user code. unfortunately,
> core.stdcpp.string's basic_string won't work with this, causing std::wstring
> support to be just out of reach
The magic `__c_wchar_t` enum could be put into core.stdcpp.config like the others, and then (existing) alias `core.stdc.stddef.wchar_t` could alias to it. Wouldn't that suffice?
Comment #4 by kinke — 2023-12-16T09:59:21Z
(In reply to kinke from comment #3)
> could be put into core.stdcpp.config like the others
Erm, `core.stdc.config`.
Comment #5 by dlang-bot — 2023-12-16T10:24:11Z
@kinke created dlang/dmd pull request #15916 "Fix Issue 22014 - Make core.stdc.stddef.wchar_t match C++ mangling" fixing this issue:
- Fix Issue 22014 - Make core.stdc.stddef.wchar_t match C++ mangling
https://github.com/dlang/dmd/pull/15916
Comment #6 by robert.schadek — 2024-12-13T19:16:58Z