Repository navigation
Description
Describe the bug, including details regarding any error messages, version, and platform.
Libc++ has made a change to stop supporting std::char_traits (and thus, also, basic_string and basic_string_view) for non-character types: https://discourse.llvm.org/t/deprecating-std-string-t-for-non-character-t/66779
Apparently, such support was never required by the standard, and is considered a mistake.
The initial libc++ change made this a hard error, but after reports of breakage, it was downgraded to a deprecation warning. See review thread https://reviews.llvm.org/D138307. It is now expected to become a hard error again in LLVM 18.
One of the projects broken is Apache Arrow, due to the usage here:
arrow/cpp/src/arrow/util/bitmap.h
Line 52 in 53752ad
| using View = util::basic_string_view<Word>; |
E.g.,
/usr/include/c++/v1/string_view:279:45: error: implicit instantiation of undefined template 'std::char_traits<unsigned long>'
static_assert((is_same<_CharT, typename traits_type::char_type>::value),
^
arrow/util/bitmap.h:153:16: note: in instantiation of template class 'std::basic_string_view<unsigned long>' requested here
View<Word> words[N];
^
arrow/compute/kernels/scalar_if_else.cc:1595:15: note: in instantiation of function template specialization 'arrow::internal::Bitmap::VisitWords<3UL, (lambda at arrow/compute/kernels/scalar_if_else.cc:1595:35), unsigned long>' requested here
Bitmap::VisitWords(bitmaps, [&](std::array<uint64_t, 3> words) {
^
arrow/compute/kernels/scalar_if_else.cc:1652:14: note: in instantiation of function template specialization 'arrow::compute::internal::(anonymous namespace)::ExecArrayCaseWhen<arrow::BooleanType>' requested here
return ExecArrayCaseWhen<Type>(ctx, batch, out);
^
arrow/compute/kernels/codegen_internal.h:1173:47: note: in instantiation of member function 'arrow::compute::internal::(anonymous namespace)::CaseWhenFunctor<arrow::BooleanType>::Exec' requested here
return Generator<BooleanType, Args...>::Exec;
^
arrow/compute/kernels/scalar_if_else.cc:2738:17: note: in instantiation of function template specialization 'arrow::compute::internal::GenerateTypeAgnosticPrimitive<arrow::compute::internal::(anonymous namespace)::CaseWhenFunctor>' requested here
auto exec = GenerateTypeAgnosticPrimitive<CaseWhenFunctor>(*type);
I suspect "View" needs to be changed to use some other type than std::basic_string_view (could be std::span if you required c++20, but you probably don't want to require c++20 yet.)
Component(s)
C++
Activity
westonpace commentedon Jan 21, 2023
Normally I think we'd want to setup a CI to regress this sort of thing. However, clang-18 is not yet released. Do you have any suggestion on how this could be regressed?
[-]basic_string_view<long> will be invalid in future libc++[/-][+][C++] basic_string_view<long> will be invalid in future libc++[/+]bkietz commentedon Jun 27, 2023
Span is relatively straightforward, I'll write a basic impl and refactor Bitmap.
apacheGH-15281: [C++] Replace bytes_view alias with span
GH-15281: [C++] Replace bytes_view alias with span (#36334)
raulcd commentedon Jul 11, 2023
@pitrou this has been tagged as 13.0.0, were you expecting this to be added to the release?
pitrou commentedon Jul 11, 2023
No, sorry. You can untag it.