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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Ah yes, thanks.

(In reply to Jonathan Wakely from comment #0)
>             _S_copy(__p, std::__niter_base(__k1), __k2 - __k1);
>  #if __cpp_lib_concepts
>           else if constexpr (contiguous_iterator<_Iterator>
> -                              && is_same_v<iter_value_t<_Iterator>, _CharT>)
> +                              && requires { { std::to_address(__k1) }
> +                                -> convertible_to<const _CharT*>; })


This needs to be:

          else if constexpr (requires {
                               requires contiguous_iterator<_Iterator>;
                               { std::to_address(__k1) }
                                 -> convertible_to<const _CharT*>;
                             })

Otherwise we evaluate the requires-expression even when contiguous_iterator
isn't satisfied, and we can't use std::to_address if it's not a contiguous
iterator.

Reply via email to