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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Michael Veksler from comment #0)
> The above function does not seem to be part of the standard, and it seems

It's (3) at https://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt2

The constraint is to implement https://wg21.link/lwg2534

> that the other compilers can work without it.

They need to provide some equivalent of it to be conforming. Apparently they
either don't provide it, or fail to constrain it as per 2534, because they fail
this:

#include <ostream>

struct X { };
std::ostream& operator<<(std::ostream& o, const X&) = delete;

template<typename T, typename = void>
struct is_streamable_to_rvalue
: std::false_type { };

template<typename T>
struct is_streamable_to_rvalue<T,
std::void_t<decltype(std::declval<std::ostream>() << std::declval<const
T&>())>>
: std::true_type { };

static_assert(!is_streamable_to_rvalue<X>::value);


For other edge cases that the current enable_if constraint addresses, see PR
80675 and PR 80940.

I don't think this testcase is valid.

Reply via email to