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

C++20 ranges/views are broken, via std::ranges::ref_view - iterator_concepts.h:980:13: error: no matching function for call to '__begin' #52696

Closed
db-src opened this issue Dec 14, 2021 · 6 comments
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts duplicate Resolved as duplicate

Comments

@db-src
Copy link

db-src commented Dec 14, 2021

It seems that range view adaptors don't work. The following example of trying to use ranges gives a pile of errors, seemingly related to ref_view being broken.

#include <algorithm>
#include <iostream>
#include <ranges>

static auto
odd(int const i)
{
    return (i & 1) == 1;
}
 
static auto
print(int const i)
{
    std::cout << i;
}

auto
main() -> int
{
    int const thenumbers[]{4, 8, 15, 16, 23, 42};
    std::ranges::for_each(thenumbers | std::views::filter(odd), print);
}

This is available on Compiler Explorer running Clang x86-64 trunk here: https://godbolt.org/z/7abh7rzaP - but the same happens in released version 13 there and on Debian

The same is true of the simple (recently edited, now compliant) example code from https://en.cppreference.com/w/cpp/ranges/transform_view ...

#include <algorithm>
#include <cstdio>
#include <iterator>
#include <ranges>
#include <string>
 
char rot13a(const char x, const char a)
{
    return a + (x - a + 13) % 26;
}
 
char rot13(const char x)
{
    if (x >= 'A' && x <= 'Z') {
        return rot13a(x, 'A');
    }
 
    if (x >= 'a' && x <= 'z') {
        return rot13a(x, 'a');
    }
 
    return x;
}
 
int main()
{
    auto show = [](const unsigned char x) { std::putchar(x); };
 
    std::string in{ "cppreference.com\n" };
    std::ranges::for_each(in, show);
    std::ranges::for_each(in | std::views::transform(rot13), show);
 
    std::string out;
    std::ranges::copy( std::views::transform(in, rot13), std::back_inserter(out) );
    std::ranges::for_each(out, show);
    std::ranges::for_each(out | std::views::transform(rot13), show);
}

... as can be seen on Compiler Explorer running Clang x86-64 trunk here - https://godbolt.org/z/xzdzjxaj4 ...

These are the errors from the 1st example:

In file included from <source>:1:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/algorithm:60:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_algobase.h:65:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_iterator_base_types.h:71:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:982:13: error: no matching function for call to '__begin'
        = decltype(ranges::__cust_access::__begin(std::declval<_Tp&>()));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:595:5: note: in instantiation of template type alias '__range_iter_t' requested here
    using iterator_t = std::__detail::__range_iter_t<_Tp>;
    ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_util.h:121:36: note: in instantiation of template type alias 'iterator_t' requested here
      requires contiguous_iterator<iterator_t<_Derived>>
                                   ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1097:29: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::ref_view<const int[6]>>' requested here
    class ref_view : public view_interface<ref_view<_Range>>
                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of template class 'std::ranges::ref_view<const int[6]>' requested here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of requirement here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:27: note: (skipping 20 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                 ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:9: note: while substituting template arguments into constraint expression here
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while checking the satisfaction of concept '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' requested here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while substituting template arguments into constraint expression here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:21:38: note: while checking constraint satisfaction for template 'operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' required here
    std::ranges::for_each(thenumbers | std::views::filter(odd), print);
                                     ^
<source>:21:38: note: in instantiation of function template specialization 'std::ranges::views::__adaptor::operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' requested here
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:966:7: note: candidate template ignored: constraints not satisfied [with _Tp = std::ranges::ref_view<const int[6]>]
      __begin(_Tp& __t)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:16: note: because 'is_array_v<std::ranges::ref_view<const int[6]> >' evaluated to false
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:35: note: and 'std::ranges::ref_view<const int[6]> &' does not satisfy '__member_begin'
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
                                  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:947:23: note: because '__decay_copy(__t.begin())' would be invalid: no member named 'begin' in 'std::ranges::ref_view<const int[6]>'
          { __decay_copy(__t.begin()) } -> input_or_output_iterator;
                             ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:59: note: and 'std::ranges::ref_view<const int[6]> &' does not satisfy '__adl_begin'
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
                                                          ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:958:19: note: because '__decay_copy(begin(__t))' would be invalid: call to deleted function 'begin'
          { __decay_copy(begin(__t)) } -> input_or_output_iterator;
                         ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:982:13: error: no matching function for call to '__begin'
        = decltype(ranges::__cust_access::__begin(std::declval<_Tp&>()));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:595:5: note: in instantiation of template type alias '__range_iter_t' requested here
    using iterator_t = std::__detail::__range_iter_t<_Tp>;
    ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_util.h:127:25: note: in instantiation of template type alias 'iterator_t' requested here
        && contiguous_iterator<iterator_t<const _Derived>>
                               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1097:29: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::ref_view<const int[6]>>' requested here
    class ref_view : public view_interface<ref_view<_Range>>
                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of template class 'std::ranges::ref_view<const int[6]>' requested here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of requirement here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:27: note: (skipping 20 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                 ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:9: note: while substituting template arguments into constraint expression here
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while checking the satisfaction of concept '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' requested here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while substituting template arguments into constraint expression here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:21:38: note: while checking constraint satisfaction for template 'operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' required here
    std::ranges::for_each(thenumbers | std::views::filter(odd), print);
                                     ^
<source>:21:38: note: in instantiation of function template specialization 'std::ranges::views::__adaptor::operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' requested here
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:966:7: note: candidate template ignored: constraints not satisfied [with _Tp = const std::ranges::ref_view<const int[6]>]
      __begin(_Tp& __t)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:16: note: because 'is_array_v<const std::ranges::ref_view<const int[6]> >' evaluated to false
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:35: note: and 'const std::ranges::ref_view<const int[6]> &' does not satisfy '__member_begin'
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
                                  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:947:23: note: because '__decay_copy(__t.begin())' would be invalid: no member named 'begin' in 'std::ranges::ref_view<const int[6]>'
          { __decay_copy(__t.begin()) } -> input_or_output_iterator;
                             ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:59: note: and 'const std::ranges::ref_view<const int[6]> &' does not satisfy '__adl_begin'
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
                                                          ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:958:19: note: because '__decay_copy(begin(__t))' would be invalid: call to deleted function 'begin'
          { __decay_copy(begin(__t)) } -> input_or_output_iterator;
                         ^
In file included from <source>:1:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/algorithm:63:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_algo.h:36:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_util.h:133:24: error: constraints not satisfied for alias template 'sentinel_t' [with _Range = std::ranges::ref_view<const int[6]>]
        && sized_sentinel_for<sentinel_t<_Derived>, iterator_t<_Derived>>
                              ^~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1097:29: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::ref_view<const int[6]>>' requested here
    class ref_view : public view_interface<ref_view<_Range>>
                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of template class 'std::ranges::ref_view<const int[6]>' requested here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of requirement here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:27: note: while substituting template arguments into constraint expression here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1173:7: note: while checking the satisfaction of concept '__can_ref_view<const int (&)[6]>' requested here
          || __detail::__can_ref_view<_Range>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1173:17: note: (skipping 18 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
          || __detail::__can_ref_view<_Range>
                       ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:9: note: while substituting template arguments into constraint expression here
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while checking the satisfaction of concept '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' requested here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while substituting template arguments into constraint expression here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:21:38: note: while checking constraint satisfaction for template 'operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' required here
    std::ranges::for_each(thenumbers | std::views::filter(odd), print);
                                     ^
<source>:21:38: note: in instantiation of function template specialization 'std::ranges::views::__adaptor::operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, const int (&)[6]>' requested here
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:597:12: note: because 'std::ranges::ref_view<const int[6]>' does not satisfy 'range'
  template<range _Range>
           ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:585:2: note: because 'ranges::begin(__t)' would be invalid: no matching function for call to object of type 'const __cust_access::_Begin'
        ranges::begin(__t);
        ^
In file included from <source>:1:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/algorithm:63:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_algo.h:36:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_util.h:139:24: error: constraints not satisfied for alias template 'sentinel_t' [with _Range = const std::ranges::ref_view<const int[6]>]
        && sized_sentinel_for<sentinel_t<const _Derived>,
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:597:12: note: because 'const std::ranges::ref_view<const int[6]>' does not satisfy 'range'
  template<range _Range>
           ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:585:2: note: because 'ranges::begin(__t)' would be invalid: no matching function for call to object of type 'const __cust_access::_Begin'
        ranges::begin(__t);
        ^
<source>:21:38: error: invalid operands to binary expression ('const int[6]' and '_Partial<std::ranges::views::_Filter, decay_t<bool (&)(int)>>' (aka '_Partial<std::ranges::views::_Filter, bool (*)(int)>'))
    std::ranges::for_each(thenumbers | std::views::filter(odd), print);
                          ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:858:7: note: candidate template ignored: constraints not satisfied [with _Self = std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>, _Range = const int (&)[6]]
      operator|(_Range&& __r, _Self&& __self)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: because '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, _Bool (*)(int)>, const int (&)[6]>' evaluated to false
        && __adaptor_invocable<_Self, _Range>
           ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:20: note: because 'std::declval<_Adaptor>()(declval<_Args>()...)' would be invalid: no matching function for call to object of type 'std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>'
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
                   ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:867:7: note: candidate template ignored: constraints not satisfied [with _Lhs = const int *, _Rhs = std::ranges::views::__adaptor::_Partial<std::ranges::views::_Filter, bool (*)(int)>]
      operator|(_Lhs __lhs, _Rhs __rhs)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:864:16: note: because 'derived_from<const int *, std::ranges::views::__adaptor::_RangeAdaptorClosure>' evaluated to false
      requires derived_from<_Lhs, _RangeAdaptorClosure>
               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/concepts:67:28: note: because '__is_base_of(std::ranges::views::__adaptor::_RangeAdaptorClosure, const int *)' evaluated to false
    concept derived_from = __is_base_of(_Base, _Derived)
                           ^
5 errors generated.
Compiler returned: 1

and 2nd:

In file included from <source>:1:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/algorithm:60:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_algobase.h:65:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/stl_iterator_base_types.h:71:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:982:13: error: no matching function for call to '__begin'
        = decltype(ranges::__cust_access::__begin(std::declval<_Tp&>()));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:595:5: note: in instantiation of template type alias '__range_iter_t' requested here
    using iterator_t = std::__detail::__range_iter_t<_Tp>;
    ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_util.h:121:36: note: in instantiation of template type alias 'iterator_t' requested here
      requires contiguous_iterator<iterator_t<_Derived>>
                                   ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1097:29: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::ref_view<std::basic_string<char>>>' requested here
    class ref_view : public view_interface<ref_view<_Range>>
                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of template class 'std::ranges::ref_view<std::basic_string<char>>' requested here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of requirement here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:27: note: (skipping 20 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                 ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:9: note: while substituting template arguments into constraint expression here
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while checking the satisfaction of concept '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' requested here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while substituting template arguments into constraint expression here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:31:30: note: while checking constraint satisfaction for template 'operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' required here
    std::ranges::for_each(in | std::views::transform(rot13), show);
                             ^
<source>:31:30: note: in instantiation of function template specialization 'std::ranges::views::__adaptor::operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' requested here
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:966:7: note: candidate template ignored: constraints not satisfied [with _Tp = std::ranges::ref_view<std::basic_string<char>>]
      __begin(_Tp& __t)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:16: note: because 'is_array_v<std::ranges::ref_view<std::basic_string<char> > >' evaluated to false
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:35: note: and 'std::ranges::ref_view<std::basic_string<char>> &' does not satisfy '__member_begin'
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
                                  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:947:23: note: because '__decay_copy(__t.begin())' would be invalid: no member named 'begin' in 'std::ranges::ref_view<std::basic_string<char>>'
          { __decay_copy(__t.begin()) } -> input_or_output_iterator;
                             ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:59: note: and 'std::ranges::ref_view<std::basic_string<char>> &' does not satisfy '__adl_begin'
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
                                                          ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:958:19: note: because '__decay_copy(begin(__t))' would be invalid: call to deleted function 'begin'
          { __decay_copy(begin(__t)) } -> input_or_output_iterator;
                         ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:982:13: error: no matching function for call to '__begin'
        = decltype(ranges::__cust_access::__begin(std::declval<_Tp&>()));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:595:5: note: in instantiation of template type alias '__range_iter_t' requested here
    using iterator_t = std::__detail::__range_iter_t<_Tp>;
    ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_util.h:127:25: note: in instantiation of template type alias 'iterator_t' requested here
        && contiguous_iterator<iterator_t<const _Derived>>
                               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1097:29: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::ref_view<std::basic_string<char>>>' requested here
    class ref_view : public view_interface<ref_view<_Range>>
                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of template class 'std::ranges::ref_view<std::basic_string<char>>' requested here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of requirement here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:27: note: (skipping 20 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                 ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:9: note: while substituting template arguments into constraint expression here
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while checking the satisfaction of concept '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' requested here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while substituting template arguments into constraint expression here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:31:30: note: while checking constraint satisfaction for template 'operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' required here
    std::ranges::for_each(in | std::views::transform(rot13), show);
                             ^
<source>:31:30: note: in instantiation of function template specialization 'std::ranges::views::__adaptor::operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' requested here
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:966:7: note: candidate template ignored: constraints not satisfied [with _Tp = const std::ranges::ref_view<std::basic_string<char>>]
      __begin(_Tp& __t)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:16: note: because 'is_array_v<const std::ranges::ref_view<std::basic_string<char> > >' evaluated to false
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:35: note: and 'const std::ranges::ref_view<std::basic_string<char>> &' does not satisfy '__member_begin'
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
                                  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:947:23: note: because '__decay_copy(__t.begin())' would be invalid: no member named 'begin' in 'std::ranges::ref_view<std::basic_string<char>>'
          { __decay_copy(__t.begin()) } -> input_or_output_iterator;
                             ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:964:59: note: and 'const std::ranges::ref_view<std::basic_string<char>> &' does not satisfy '__adl_begin'
      requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
                                                          ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/iterator_concepts.h:958:19: note: because '__decay_copy(begin(__t))' would be invalid: call to deleted function 'begin'
          { __decay_copy(begin(__t)) } -> input_or_output_iterator;
                         ^
In file included from <source>:1:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/algorithm:63:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_algo.h:36:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_util.h:133:24: error: constraints not satisfied for alias template 'sentinel_t' [with _Range = std::ranges::ref_view<std::basic_string<char>>]
        && sized_sentinel_for<sentinel_t<_Derived>, iterator_t<_Derived>>
                              ^~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1097:29: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::ref_view<std::basic_string<char>>>' requested here
    class ref_view : public view_interface<ref_view<_Range>>
                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of template class 'std::ranges::ref_view<std::basic_string<char>>' requested here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:38: note: in instantiation of requirement here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1151:27: note: while substituting template arguments into constraint expression here
        concept __can_ref_view = requires { ref_view{std::declval<_Range>()}; };
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1173:7: note: while checking the satisfaction of concept '__can_ref_view<std::basic_string<char> &>' requested here
          || __detail::__can_ref_view<_Range>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1173:17: note: (skipping 18 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
          || __detail::__can_ref_view<_Range>
                       ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:9: note: while substituting template arguments into constraint expression here
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while checking the satisfaction of concept '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' requested here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: while substituting template arguments into constraint expression here
        && __adaptor_invocable<_Self, _Range>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:31:30: note: while checking constraint satisfaction for template 'operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' required here
    std::ranges::for_each(in | std::views::transform(rot13), show);
                             ^
<source>:31:30: note: in instantiation of function template specialization 'std::ranges::views::__adaptor::operator|<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' requested here
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:597:12: note: because 'std::ranges::ref_view<std::basic_string<char>>' does not satisfy 'range'
  template<range _Range>
           ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:585:2: note: because 'ranges::begin(__t)' would be invalid: no matching function for call to object of type 'const __cust_access::_Begin'
        ranges::begin(__t);
        ^
In file included from <source>:1:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/algorithm:63:
In file included from /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_algo.h:36:
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_util.h:139:24: error: constraints not satisfied for alias template 'sentinel_t' [with _Range = const std::ranges::ref_view<std::basic_string<char>>]
        && sized_sentinel_for<sentinel_t<const _Derived>,
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:597:12: note: because 'const std::ranges::ref_view<std::basic_string<char>>' does not satisfy 'range'
  template<range _Range>
           ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ranges_base.h:585:2: note: because 'ranges::begin(__t)' would be invalid: no matching function for call to object of type 'const __cust_access::_Begin'
        ranges::begin(__t);
        ^
<source>:31:30: error: invalid operands to binary expression ('std::string' (aka 'basic_string<char>') and '_Partial<std::ranges::views::_Transform, decay_t<char (&)(char)>>' (aka '_Partial<std::ranges::views::_Transform, char (*)(char)>'))
    std::ranges::for_each(in | std::views::transform(rot13), show);
                          ~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ios_base.h:87:3: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'std::_Ios_Fmtflags' for 1st argument
  operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ios_base.h:130:3: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'std::_Ios_Openmode' for 1st argument
  operator|(_Ios_Openmode __a, _Ios_Openmode __b)
  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ios_base.h:170:3: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'std::_Ios_Iostate' for 1st argument
  operator|(_Ios_Iostate __a, _Ios_Iostate __b)
  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/cstddef:132:3: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'std::byte' for 1st argument
  operator|(byte __l, byte __r) noexcept
  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:858:7: note: candidate template ignored: constraints not satisfied [with _Self = std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, _Range = std::basic_string<char> &]
      operator|(_Range&& __r, _Self&& __self)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: because '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' evaluated to false
        && __adaptor_invocable<_Self, _Range>
           ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:20: note: because 'std::declval<_Adaptor>()(declval<_Args>()...)' would be invalid: no matching function for call to object of type 'std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>'
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
                   ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:867:7: note: candidate template ignored: constraints not satisfied [with _Lhs = std::basic_string<char>, _Rhs = std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>]
      operator|(_Lhs __lhs, _Rhs __rhs)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:864:16: note: because 'derived_from<std::basic_string<char>, std::ranges::views::__adaptor::_RangeAdaptorClosure>' evaluated to false
      requires derived_from<_Lhs, _RangeAdaptorClosure>
               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/concepts:67:28: note: because '__is_base_of(std::ranges::views::__adaptor::_RangeAdaptorClosure, std::basic_string<char>)' evaluated to false
    concept derived_from = __is_base_of(_Base, _Derived)
                           ^
<source>:34:24: error: no matching function for call to object of type 'const std::ranges::views::_Transform'
    std::ranges::copy( std::views::transform(in, rot13), std::back_inserter(out) );
                       ^~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1975:2: note: candidate template ignored: constraints not satisfied [with _Range = std::basic_string<char> &, _Fp = char (&)(char)]
        operator() [[nodiscard]] (_Range&& __r, _Fp&& __f) const
        ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1973:21: note: because '__detail::__can_transform_view<std::basic_string<char> &, char (&)(char)>' evaluated to false
        requires __detail::__can_transform_view<_Range, _Fp>
                           ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:1967:17: note: because 'transform_view(std::declval<_Range>(), std::declval<_Fp>())' would be invalid: no viable constructor or deduction guide for deduction of template arguments of 'transform_view'
          = requires { transform_view(std::declval<_Range>(), std::declval<_Fp>()); };
                       ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:890:2: note: candidate template ignored: constraints not satisfied [with _Args = <std::basic_string<char> &, char (&)(char)>]
        operator()(_Args&&... __args) const
        ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:888:11: note: because '__adaptor_partial_app_viable<std::ranges::views::_Transform, std::basic_string<char> &, char (&)(char)>' evaluated to false
        requires __adaptor_partial_app_viable<_Derived, _Args...>
                 ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:837:11: note: because 'sizeof...(_Args) == _Transform::_S_arity - 1' (2 == 1) evaluated to false
      && (sizeof...(_Args) == _Adaptor::_S_arity - 1)
          ^
<source>:36:31: error: invalid operands to binary expression ('std::string' (aka 'basic_string<char>') and '_Partial<std::ranges::views::_Transform, decay_t<char (&)(char)>>' (aka '_Partial<std::ranges::views::_Transform, char (*)(char)>'))
    std::ranges::for_each(out | std::views::transform(rot13), show);
                          ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ios_base.h:87:3: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'std::_Ios_Fmtflags' for 1st argument
  operator|(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ios_base.h:130:3: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'std::_Ios_Openmode' for 1st argument
  operator|(_Ios_Openmode __a, _Ios_Openmode __b)
  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/bits/ios_base.h:170:3: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'std::_Ios_Iostate' for 1st argument
  operator|(_Ios_Iostate __a, _Ios_Iostate __b)
  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/cstddef:132:3: note: candidate function not viable: no known conversion from 'std::string' (aka 'basic_string<char>') to 'std::byte' for 1st argument
  operator|(byte __l, byte __r) noexcept
  ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:858:7: note: candidate template ignored: constraints not satisfied [with _Self = std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, _Range = std::basic_string<char> &]
      operator|(_Range&& __r, _Self&& __self)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:856:5: note: because '__adaptor_invocable<std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>, std::basic_string<char> &>' evaluated to false
        && __adaptor_invocable<_Self, _Range>
           ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:831:20: note: because 'std::declval<_Adaptor>()(declval<_Args>()...)' would be invalid: no matching function for call to object of type 'std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>'
      = requires { std::declval<_Adaptor>()(declval<_Args>()...); };
                   ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:867:7: note: candidate template ignored: constraints not satisfied [with _Lhs = std::basic_string<char>, _Rhs = std::ranges::views::__adaptor::_Partial<std::ranges::views::_Transform, char (*)(char)>]
      operator|(_Lhs __lhs, _Rhs __rhs)
      ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/ranges:864:16: note: because 'derived_from<std::basic_string<char>, std::ranges::views::__adaptor::_RangeAdaptorClosure>' evaluated to false
      requires derived_from<_Lhs, _RangeAdaptorClosure>
               ^
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/12.0.0/../../../../include/c++/12.0.0/concepts:67:28: note: because '__is_base_of(std::ranges::views::__adaptor::_RangeAdaptorClosure, std::basic_string<char>)' evaluated to false
    concept derived_from = __is_base_of(_Base, _Derived)
                           ^
7 errors generated.
Compiler returned: 1
@mkurdej mkurdej added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. libc++abi libc++abi C++ Runtime Library. Not libc++. and removed libc++abi libc++abi C++ Runtime Library. Not libc++. labels Dec 14, 2021
@db-src
Copy link
Author

db-src commented Dec 14, 2021

related:

@ldionne
Copy link
Member

ldionne commented Dec 14, 2021

Clang on Godbolt uses libstdc++ by default, not libc++. You need to pass -stdlib=libc++ in order to use libc++: https://godbolt.org/z/f3cdjT61x.

If you do that, you will see that libc++ does not implement all of ranges yet, but we're working on it. In fact, we don't even enable Ranges in the version of LLVM we ship (e.g. 12.0) because we wanted to have a coherent whole before shipping anything.

TLDR: You should report this bug to libstdc++ instead, and you should drop your whiny tone that makes it sound as-if the people who contribute to these OPEN SOURCE projects owe you something, cause that's not helping your case.

@ldionne ldionne closed this as completed Dec 14, 2021
@db-src
Copy link
Author

db-src commented Dec 15, 2021

Thanks for the explanation, and I apologise for my previous tone.

@mkurdej mkurdej removed the new issue label Dec 28, 2021
@jwakely
Copy link
Contributor

jwakely commented Jan 11, 2022

TLDR: You should report this bug to libstdc++ instead

Please don't, we have more than one report for this already, and it's a Clang bug: #44178

@Quuxplusone Quuxplusone added clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts and removed libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. labels Jan 16, 2022
@llvmbot
Copy link
Member

llvmbot commented Jan 16, 2022

@llvm/issue-subscribers-clang-frontend

@Quuxplusone Quuxplusone added the duplicate Resolved as duplicate label Jan 27, 2022
@bachittle
Copy link

this is fixed as of the latest commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" concepts C++20 concepts duplicate Resolved as duplicate
Projects
Status: No status
Development

No branches or pull requests

8 participants