Skip to content
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

Implement LWG-3767 codecvt<charN_t, char8_t, mbstate_t> incorrectly added to locale #4542

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

Fixes #4498. The message in warning STL4020 should also be changed.

I think std::filesystem::path is the only thing in the C++ standard library that can be used as a replacement.

Currently this PR applies the deprecation to C++20 mode to be consistent with _CXX20_DEPRECATE_CODECVT_FACETS, but I'm not sure whether this is appropriate.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner March 30, 2024 12:18
@StephanTLavavej StephanTLavavej self-assigned this Mar 30, 2024
@StephanTLavavej StephanTLavavej added the LWG Library Working Group issue label Mar 30, 2024
Shrink the primary template's `_ENFORCE_FACET_SPECIALIZATIONS` list because `codecvt_byname<char16_t, char8_t, mbstate_t>` and `codecvt_byname<char32_t, char8_t, mbstate_t>` are becoming (deprecated) explicit specializations.

Note that `codecvt_byname<char16_t, char, mbstate_t>` and `codecvt_byname<char32_t, char, mbstate_t>` were simply missing.

Add the old and new deprecated explicit specializations, the latter being guarded by `#ifdef __cpp_char8_t`. Note that (unlike the primary template) they can use the injected-class-name `codecvt` in their delegating constructors because it isn't dependent anymore.

There didn't seem to be a simple way to centralize this repetition without adding too much complexity, so I just spammed it out.

We need to `_STL_DISABLE_DEPRECATED_WARNING`/`_STL_RESTORE_DEPRECATED_WARNING` because the base classes are deprecated.
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Outdated Show resolved Hide resolved
stl/inc/yvals_core.h Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 9465bb0 into microsoft:main Apr 9, 2024
35 checks passed
@StephanTLavavej
Copy link
Member

⚠️ 🐶 ⚠️

@frederick-vs-ja frederick-vs-ja deleted the lwg-3767 branch April 9, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LWG Library Working Group issue
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

LWG-3767 codecvt<charN_t, char8_t, mbstate_t> incorrectly added to locale
2 participants