https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102807

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
#include <ranges>

struct Range
{
  int* begin() { return 0; }
  int* end() { return 0; }
};

int main()
{
    static_assert(std::ranges::range<Range>);
    using R = std::ranges::ref_view<Range>;
    static_assert( std::ranges::__cust_access::__member_begin<R> );
}

The problem happens when instantiating ref_view<R> for any R. The
view_interface<ref_view<R>> CRTP base class gets instantiated and that checks
the constraints of its member functions, which depends on the derived class,
which is incomplete at that point.

I think this is a clang bug. It should not be checking the constraints for
view_interface<ref_view<Range>>::data() when checking satisfaction of
range<ref_view<Range>>.

Reply via email to