[libcxx-commits] [clang] [libcxx] [Clang] Normalize constraints before checking for satisfaction (PR #161671)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Oct 4 15:15:21 PDT 2025


ronlieb wrote:

we are also seeing downstream failures related to this PR, seems to be with older GCC toolchains such as found on SLES 15 sp6. maybe revert and fix ?

/longer_pathname_so_that_rpms_can_support_packaging_the_debug_info_for_all_os_profiles/src/rocm_bandwidth_test/deps/work_bench/src/task_mgmt.cpp:435:5: error: no matching function for call to object of type 'const __copy_fn'
  435 |     std::ranges::copy(task_name | std::views::take(kMAX_THREAD_NAME_SIZE - 1), current_thread_name.begin());
      |     ^~~~~~~~~~~~~~~~~
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/bits/ranges_algobase.h:311:7: note: candidate template ignored: constraints not satisfied [with _Range = _Partial<std::ranges::views::_Take, decay_t<const std::basic_string<char, std::char_traits<char>, std::allocator<char>> &>, decay_t<const int &>>, _Out = iterator]
  311 |       operator()(_Range&& __r, _Out __result) const
      |       ^
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/bits/ranges_algobase.h:308:14: note: because '_Partial<std::ranges::views::_Take, decay_t<const std::basic_string<char, std::char_traits<char>, std::allocator<char>> &>, decay_t<const int &>>' (aka '_Partial<std::ranges::views::_Take, std::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>') does not satisfy 'input_range'
  308 |     template<input_range _Range, weakly_incrementable _Out>
      |              ^
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/bits/ranges_base.h:590:27: note: because 'std::ranges::views::__adaptor::_Partial<std::ranges::views::_Take, std::basic_string<char>, int>' does not satisfy 'range'
  590 |     concept input_range = range<_Tp> && input_iterator<iterator_t<_Tp>>;
      |                           ^
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/bits/ranges_base.h:503:2: note: because 'ranges::begin(__t)' would be invalid: no matching function for call to object of type 'const __cust_access::_Begin'
  503 |         ranges::begin(__t);
      |         ^
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/bits/ranges_algobase.h:301:7: note: candidate function template not viable: requires 3 arguments, but 2 were provided
  301 |       operator()(_Iter __first, _Sent __last, _Out __result) const
      |       ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

https://github.com/llvm/llvm-project/pull/161671


More information about the libcxx-commits mailing list