https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121646
Patrick Palka <ppalka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ppalka at gcc dot gnu.org --- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> --- Reduced: template<class T> concept range = requires (T t) { t.begin(); }; struct string_view { string_view(const char*); template<range R> string_view(R &&); const char* begin(); const char* end(); }; struct my_string { char* ptr; operator string_view () const; auto begin() const { return string_view(*this).begin(); } auto end() const { return string_view(*this).end(); } }; static_assert(range<my_string>); This might be an "ill-formed, no diagnostic required" situation. A workaround is to declare begin()/end() with the concrete return type std::string_view::iterator.