[libcxx-commits] [PATCH] D138307: [libc++] Remove default definition of std::char_traits

Tom Honermann via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 23 10:01:29 PST 2022


tahonermann added a comment.

> This breaks Apache Arrow, which makes a basic_string_view<unsigned long>

Hmm, this usage is exposed in the interface (see the `words()` member function template of the `Bitmap` class template). Ick. Are there tests that demonstrate that the code actually works as intended when `Word` is not one of the standard character types?

> Also breaks v8, which uses a std::basic_string<uint16_t> member

At least in this case, the use is an implementation detail. It looks to me like this class could be relatively easily changed to use `std::vector` instead. Additional code would be required to ensure null termination, but it at least looks like there are no obvious dependencies on `char_traits`.

> One thing we could do is instead deprecate the whole base template (but still provide an implementation) so as to give folks two releases to get off of it. I'm pretty skeptical about std::string working as intended for unsigned long, but whatever.

That seems prudent. I think it is likely that we'll see additional reports of breakage.

This is something we should communicate to the community via the Announcements (https://discourse.llvm.org/c/announce/46) channel following the conclusion of discussion at https://discourse.llvm.org/t/rfc-add-new-discourse-channel-for-potentially-breaking-disruptive-changes-for-clang/65251.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138307/new/

https://reviews.llvm.org/D138307



More information about the libcxx-commits mailing list