Skip to content

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

Merged
vitaut merged 1 commit into
fmtlib:masterfrom
phprus:llvm-1
Sep 18, 2023
Merged

vitaut merged 1 commit into
fmtlib:masterfrom
phprus:llvm-1

Conversation

@phprus

@phprus phprus commented Sep 11, 2023

Copy link
Copy Markdown
Contributor

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

@vitaut vitaut left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread .github/workflows/linux.yml Outdated
Comment thread test/xchar-test.cc
# ifdef _LIBCPP_VERSION
namespace std {

template <> struct char_traits<custom_char> {

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread test/xchar-test.cc Outdated
@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 <vladislav@shchapov.ru>
@vitaut
vitaut merged commit 492a99c into fmtlib:master Sep 18, 2023
@vitaut

vitaut commented Sep 18, 2023

Copy link
Copy Markdown
Contributor

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 <vladislav@shchapov.ru>
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