Re: [v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.

2016-11-30 Thread Ville Voutilainen
On 1 December 2016 at 09:14, Ville Voutilainen
 wrote:
>> Yes it does. Thank you.
> Committed as obvious-enough.

Also, if this change causes one more problem I'm reverting all of it,
we _are_ in stage 3 and this sort of churn
is not exactly desirable. I'm currently hiding in a basement so as to
avoid the wrath of release managers anyway. :)


Re: [v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.

2016-11-30 Thread Ville Voutilainen
On 1 December 2016 at 08:45, Markus Trippelsdorf  wrote:
> On 2016.12.01 at 08:11 +0200, Ville Voutilainen wrote:
>> On 1 December 2016 at 07:38, Markus Trippelsdorf  
>> wrote:
>> > It breaks building Firefox:
>>
>> Sigh, when writing a trait, write a proper trait. Does this patch fix
>> the problem?
>
> Yes it does. Thank you.


Committed as obvious-enough.


Re: [v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.

2016-11-30 Thread Markus Trippelsdorf
On 2016.12.01 at 08:11 +0200, Ville Voutilainen wrote:
> On 1 December 2016 at 07:38, Markus Trippelsdorf  
> wrote:
> > It breaks building Firefox:
> 
> Sigh, when writing a trait, write a proper trait. Does this patch fix
> the problem?

Yes it does. Thank you.

-- 
Markus


Re: [v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.

2016-11-30 Thread Ville Voutilainen
On 1 December 2016 at 07:38, Markus Trippelsdorf  wrote:
> It breaks building Firefox:


Sigh, when writing a trait, write a proper trait. Does this patch fix
the problem?

2016-12-01  Ville Voutilainen  

The convertible_to traits need to use a variadic catch-all for the
false-cases.
* include/std/istream (__is_convertible_to_basic_istream):
Change the parameter of the false-case of __check to a variadic.
* include/std/ostream (__is_convertible_to_basic_ostream):
Likewise.
diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream
index 319e226..1d77d30 100644
--- a/libstdc++-v3/include/std/istream
+++ b/libstdc++-v3/include/std/istream
@@ -915,7 +915,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template
   static basic_istream<_Ch, _Up>& __check(basic_istream<_Ch, _Up>*);
 
-  static void __check(void*);
+  static void __check(...);
 public:
   using istream_type =
decltype(__check(declval::type*>()));
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index 70fd10b..9dea778 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -619,7 +619,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 template
 static basic_ostream<_Ch, _Up>& __check(basic_ostream<_Ch, _Up>*);
 
-static void __check(void*);
+static void __check(...);
   public:
 using ostream_type =
   decltype(__check(declval::type*>()));


Re: [v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.

2016-11-30 Thread Markus Trippelsdorf
On 2016.11.30 at 16:25 +, 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’:
/home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:656:5:   required 
by substitution of ‘template typename 
std::enable_if >, 
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::__check(const mozilla::unused_t*)’
   decltype(__check(declval::type*>()));
~~~^~
/home/trippels/gcc_test/usr/local/include/c++/7.0.0/ostream:620:37: note: 
candidate: template 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::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&] 
 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::type*>()));

Re: [v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.

2016-11-30 Thread Jonathan Wakely

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.




[v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.

2016-11-30 Thread Ville Voutilainen
2016-11-30  Ville Voutilainen  

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.
diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream
index 4f0e940..81df402 100644
--- a/libstdc++-v3/include/std/istream
+++ b/libstdc++-v3/include/std/istream
@@ -913,11 +913,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 struct __is_convertible_to_basic_istream
 {
   template
-  static true_type __check(basic_istream<_Ch, _Up>*);
+  static basic_istream<_Ch, _Up>& __check(basic_istream<_Ch, _Up>*);
 
-  static false_type __check(void*);
+  static void __check(void*);
 public:
-  using type = decltype(__check(declval<_Tp*>()));
+  using stream_type = decltype(__check(declval<_Tp*>()));
+  using type = __not_>;
   constexpr static bool value = type::value;
   };
 
@@ -949,7 +950,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  __is_convertible_to_basic_istream<
typename remove_reference<_Istream>::type>,
  __is_extractable<_Istream&, _Tp&&>>::value,
-  _Istream&>::type
+  typename __is_convertible_to_basic_istream<
+typename
+remove_reference<_Istream>::type>::stream_type>::type
 operator>>(_Istream&& __is, _Tp&& __x)
 {
   __is >> std::forward<_Tp>(__x);
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index a1fe892..64db7c7 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -617,11 +617,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 struct __is_convertible_to_basic_ostream
   {
 template
-static true_type __check(basic_ostream<_Ch, _Up>*);
+static basic_ostream<_Ch, _Up>& __check(basic_ostream<_Ch, _Up>*);
 
-static false_type __check(void*);
+static void __check(void*);
   public:
-using type = decltype(__check(declval<_Tp*>()));
+using stream_type = decltype(__check(declval<_Tp*>()));
+using type = __not_>;
 constexpr static bool value = type::value;
   };
 
@@ -650,8 +651,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
  __is_convertible_to_basic_ostream<
typename remove_reference<_Ostream>::type>,
  __is_insertable<_Ostream&, const _Tp&>>::value,
-  _Ostream&>::type
- //basic_ostream<_CharT, _Traits>&
+  typename __is_convertible_to_basic_ostream<
+typename
+remove_reference<_Ostream>::type>::stream_type>::type
 operator<<(_Ostream&& __os, const _Tp& __x)
 {
   __os << __x;