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

Fix deprecation warning in libc++ (LLVM-16) #3634

Merged
merged 1 commit into from
Sep 18, 2023
Merged

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Sep 11, 2023

Warning:

'char_traits<custom_char>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Werror,-Wdeprecated-declarations]

LLVM source:

https://github.com/llvm/llvm-project/blob/7cbf1a2591520c2491aa35339f227775f4d3adf6/libcxx/include/__string/char_traits.h#L74-L80

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. A few comments inline.

.github/workflows/linux.yml Outdated Show resolved Hide resolved
# ifdef _LIBCPP_VERSION
namespace std {

template <> struct char_traits<custom_char> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the standard permit user specializations of char_traits?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://en.cppreference.com/w/cpp/string/char_traits:

The char_traits class template serves as a basis for explicit instantiations. The user can provide a specialization for any custom character types. Several explicit specializations are provided for the standard character types (see below), other specializations are not required to satisfy the requirements of CharTraits.

test/xchar-test.cc Outdated Show resolved Hide resolved
@phprus phprus force-pushed the llvm-1 branch 2 times, most recently from 4887c24 to 7bf9899 Compare September 17, 2023 15:52
…or T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Werror,-Wdeprecated-declarations]

Signed-off-by: Vladislav Shchapov <[email protected]>
@vitaut vitaut merged commit 492a99c into fmtlib:master Sep 18, 2023
40 checks passed
@vitaut
Copy link
Contributor

vitaut commented Sep 18, 2023

Thank you!

ckerr pushed a commit to transmission/fmt that referenced this pull request Nov 7, 2023
…or T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Werror,-Wdeprecated-declarations] (fmtlib#3634)

Signed-off-by: Vladislav Shchapov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants