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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Right the problem is here (and not with the compiler itself if there is a
> problem):
> /home/ubuntu/upstream-gcc/include/c++/11.0.1/ostream:747:46: error: no match
> for ‘operator<<’ (operand types are ‘std::basic_ostream<char>’ and ‘const
> std::vector<int>’)
>   746 |                            __void_t<decltype(declval<_Ostream&>()
>       |                                              ~~~~~~~~~~~~~~~~~~~~
>   747 |                                              << declval<const
> _Tp&>())>>
>       |                                              ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> But by definition at this point operator << does not exist and is not
> considered as it is not found via ADL because both std::basic_ostream<char>
> and std::vector<int> are in the std namespace and the global namespace is
> not considered.
> 
> /home/ubuntu/upstream-gcc/include/c++/11.0.1/ostream:773:5:   required by
> substitution of ‘template<class _Ostream, class _Tp> typename
> std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >,
> std::__is_convertible_to_basic_ostream<_Ostream>,
> std::__is_insertable<typename
> std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type, const _Tp&,
> void> >::value, typename
> std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type>::type
> std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = CustomStream; _Tp =
> std::vector<int>]’
> t78.cc:21:41:   required from here
>   template<typename _Ostream, typename _Tp>
>     inline
>     typename enable_if<__and_<__not_<is_lvalue_reference<_Ostream>>,
>                               __is_convertible_to_basic_ostream<_Ostream>,
>                               __is_insertable<
>                                 __rvalue_ostream_type<_Ostream>,
>                                 const _Tp&>>::value,
>                        __rvalue_ostream_type<_Ostream>>::type
>     operator<<(_Ostream&& __os, const _Tp& __x)
> 
> It is the __is_insertable in the above.
> So it might be the wrong type being used to check __is_insertable ....

If anything it is the __rvalue_ostream_type<_Ostream> part if I am reading this
code correctly.

Reply via email to