-
Notifications
You must be signed in to change notification settings - Fork 1.5k
<locale>
: Repair std::collate<unsigned short>
#5361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<locale>
: Repair std::collate<unsigned short>
#5361
Conversation
tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp
Outdated
Show resolved
Hide resolved
Thanks! I updated the product code's preprocessor logic, pushed significant changes to the test, and updated the PR description accordingly - please meow if I messed something up. The general principle that we now follow (although our legacy codebase didn't) is that while |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for fixing the world's best library with the world's worst compiler option! 😹 💚 🎉 |
This repairs
collate<unsigned short>
by adding two missingunsigned short
specializations for_LStrcoll
and_LStrxfrm
when we're building the STL. Fixes #5236.There are similar specializations for a few functions in
<xlocale>
. I guess_LStrcoll
and_LStrxfrm
were missed because they are located in a different header.Since
collate
is the only user of these functions, I also moved them from<xlocinfo>
to<locale>
just abovecollate
.As for why this also fixes
collate<wchar_t>
=collate<unsigned short>
under non-nativewchar_t
when linking to the DLL, this is because the the locale facets are constructed in the DLL here:STL/stl/src/wlocale.cpp
Lines 58 to 88 in f2a2933
Thus,
collate
's virtual functions originate from the DLL as well. These virtual functions call_LStrcoll
and_LStrxfrm
, but the specializations forunsigned short
were missing since the DLL is built with nativewchar_t
.In the new test, we have to skip
collate::transform()
tests when there is IDL mismatch between TU and linked DLL.