On 2016.11.30 at 16:25 +0000, Jonathan Wakely wrote: > On 30/11/16 17:58 +0200, Ville Voutilainen wrote: > > Fix testsuite failures caused by the patch implementing LWG 2534. > > * include/std/istream (__is_convertible_to_basic_istream): > > Change the return types of __check, introduce stream_type. > > (operator>>(_Istream&&, _Tp&&)): > > Use __is_convertible_to_basic_istream::stream_type as the return type. > > * include/std/ostream (__is_convertible_to_basic_ostream): > > Change the return types of __check, introduce stream_type. > > (operator>>(_Ostream&&, _Tp&&)): > > Use __is_convertible_to_basic_ostream::stream_type as the return type. > > As discussed on IRC, please change "stream_type" to istream_type and > ostream_type, as appropriate, because those names are already used by > stream iterators, so users can't define them as macros. > > And you could make the remove_reference happen inside the > __is_convertible_to_basic_[io]stream trait, since it's only ever used > with references, but that seems stylistic. > > OK with the stream_type renaming.
It breaks building Firefox: In file included from ../../dist/system_wrappers/ostream:4:0, from ../../dist/stl_wrappers/ostream:55, from /home/trippels/gcc_test/usr/local/include/c++/7.0.0/iterator:64, from ../../dist/system_wrappers/iterator:4, from ../../dist/stl_wrappers/iterator:55, from /home/trippels/gcc_test/usr/local/include/c++/7.0.0/backward/hashtable.h:63, from /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ext/hash_map:64, from /home/trippels/gecko-dev/ipc/chromium/src/base/hash_tables.h:43, from /home/trippels/gecko-dev/ipc/chromium/src/base/file_path.h:72, from /home/trippels/gecko-dev/ipc/chromium/src/chrome/common/ipc_message_utils.h:12, from ../../dist/include/ipc/IPCMessageUtils.h:11, from ../../dist/include/mozilla/ipc/Transport_posix.h:11, from ../../dist/include/mozilla/ipc/Transport.h:15, from /home/trippels/gecko-dev/ipc/glue/BackgroundChild.h:10, from /home/trippels/gecko-dev/ipc/glue/BackgroundImpl.cpp:5, from /home/trippels/moz-build-dir/ipc/glue/Unified_cpp_ipc_glue0.cpp:2: /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream: In instantiation of ‘struct std::__is_convertible_to_basic_ostream<const mozilla::unused_t&>’: /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:656: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<_Ostream&, const _Tp&, void> >::value, typename std::__is_convertible_to_basic_ostream<_Tp>::ostream_type>::type std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = const mozilla::unused_t&; _Tp = {anonymous}::ParentImpl*]’ ../../dist/include/nsCOMPtr.h:185:13: required from ‘void operator<<(const mozilla::unused_t&, const already_AddRefed<{anonymous}::ParentImpl>&)’ /home/trippels/gecko-dev/ipc/glue/BackgroundImpl.cpp:1981:32: required from here /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:625:23: error: no matching function for call to ‘std::__is_convertible_to_basic_ostream<const mozilla::unused_t&>::__check(const mozilla::unused_t*)’ decltype(__check(declval<typename remove_reference<_Tp>::type*>())); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:620:37: note: candidate: template<class _Ch, class _Up> static std::basic_ostream<_Ch, _Up>& std::__is_convertible_to_basic_ostream<_Tp>::__check(std::basic_ostream<_Ch, _Up>*) [with _Ch = _Ch; _Up = _Up; _Tp = const mozilla::unused_t&] static basic_ostream<_Ch, _Up>& __check(basic_ostream<_Ch, _Up>*); ^~~~~~~ /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:620:37: note: template argument deduction/substitution failed: /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:625:23: note: types ‘std::basic_ostream<_CharT, _Traits>’ and ‘const mozilla::unused_t’ have incompatible cv-qualifiers decltype(__check(declval<typename remove_reference<_Tp>::type*>())); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:622:17: note: candidate: static void std::__is_convertible_to_basic_ostream<_Tp>::__check(void*) [with _Tp = const mozilla::unused_t&] <near match> static void __check(void*); ^~~~~~~ /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:622:17: note: conversion of argument 1 would be ill-formed: /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:625:23: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive] decltype(__check(declval<typename remove_reference<_Tp>::type*>())); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:625:23: error: no matching function for call to ‘std::__is_convertible_to_basic_ostream<const mozilla::unused_t&>::__check(const mozilla::unused_t*)’ /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:620:37: note: candidate: template<class _Ch, class _Up> static std::basic_ostream<_Ch, _Up>& std::__is_convertible_to_basic_ostream<_Tp>::__check(std::basic_ostream<_Ch, _Up>*) [with _Ch = _Ch; _Up = _Up; _Tp = const mozilla::unused_t&] static basic_ostream<_Ch, _Up>& __check(basic_ostream<_Ch, _Up>*); ^~~~~~~ /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:620:37: note: template argument deduction/substitution failed: /home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:625:23: note: types ‘std::basic_ostream<_CharT, _Traits>’ and ‘const mozilla::unused_t’ have incompatible cv-qualifiers decltype(__check(declval<typename remove_reference<_Tp>::type*>())); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Markus