Thread overview
[Issue 22014] Wrong MSVC++ mangling of wchar_t
Jan 17, 2022
Dlang Bot
Dec 17, 2022
Iain Buclaw
Dec 16
kinke
Dec 16
kinke
Dec 16
Dlang Bot
January 17, 2022
https://issues.dlang.org/show_bug.cgi?id=22014

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@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

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=22014

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 15
https://issues.dlang.org/show_bug.cgi?id=22014

elpenguino+D@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |elpenguino+D@gmail.com

--- Comment #2 from elpenguino+D@gmail.com ---
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

--
December 16
https://issues.dlang.org/show_bug.cgi?id=22014

--- Comment #3 from kinke <kinke@gmx.net> ---
(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?

--
December 16
https://issues.dlang.org/show_bug.cgi?id=22014

--- Comment #4 from kinke <kinke@gmx.net> ---
(In reply to kinke from comment #3)
> could be put into core.stdcpp.config like the others

Erm, `core.stdc.config`.

--
December 16
https://issues.dlang.org/show_bug.cgi?id=22014

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@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

--