Skip to content

Commit 30cbdcb

Browse files
committed
[libc++] Revert to previous implementation of __has_rebind
The new implementation introduced in 5b1e5b4 broke the bot running GCC 5.
1 parent 1044ee8 commit 30cbdcb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

libcxx/include/memory

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,12 +841,16 @@ struct __pointer_traits_difference_type<_Ptr, true>
841841
typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::difference_type type;
842842
};
843843

844-
template <class _Tp, class _Up, class = void>
845-
struct __has_rebind : false_type {};
846-
847844
template <class _Tp, class _Up>
848-
struct __has_rebind<_Tp, _Up,
849-
typename __void_t<typename _Tp::template rebind<_Up> >::type> : true_type {};
845+
struct __has_rebind
846+
{
847+
private:
848+
struct __two {char __lx; char __lxx;};
849+
template <class _Xp> static __two __test(...);
850+
template <class _Xp> static char __test(typename _Xp::template rebind<_Up>* = 0);
851+
public:
852+
static const bool value = sizeof(__test<_Tp>(0)) == 1;
853+
};
850854

851855
template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
852856
struct __pointer_traits_rebind

0 commit comments

Comments
 (0)