https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80675
--- Comment #3 from ville at gcc dot gnu.org --- Author: ville Date: Wed Jun 21 21:09:46 2017 New Revision: 249471 URL: https://gcc.gnu.org/viewcvs?rev=249471&root=gcc&view=rev Log: PR libstdc++/80675, PR libstdc++/80940 Backport from mainline 2017-06-21 Ville Voutilainen <ville.voutilai...@gmail.com> PR libstdc++/80675 PR libstdc++/80940 * include/std/istream: (__is_convertible_to_basic_istream_test(basic_istream<_Ch, _Up>*)): New. (__do_is_convertible_to_basic_istream_impl): Likewise. (__is_convertible_to_basic_istream_impl): Likewise. (__is_convertible_to_basic_istream): Use the new base. (__rvalue_istream_type): New. (operator>>(_Istream&&, _Tp&&)): Use the new helper alias for the SFINAE check, convert to the helper alias type before doing the actual extraction. * include/std/ostream: (__is_convertible_to_basic_ostream_test(basic_ostream<_Ch, _Up>*)): New. (__do_is_convertible_to_basic_ostream_impl): Likewise. (__is_convertible_to_basic_ostream_impl): Likewise. (__is_convertible_to_basic_ostream): Use the new base. (__rvalue_ostream_type): New. (operator<<(_Ostream&&, const _Tp&)): Use the new helper alias for the SFINAE check, convert to the helper alias type before doing the actual insertion. * testsuite/27_io/rvalue_streams-2.cc: Add new tests. Modified: branches/gcc-7-branch/libstdc++-v3/ChangeLog branches/gcc-7-branch/libstdc++-v3/include/std/istream branches/gcc-7-branch/libstdc++-v3/include/std/ostream branches/gcc-7-branch/libstdc++-v3/testsuite/27_io/rvalue_streams-2.cc