From: Louis Dionne Date: Wed, 4 Mar 2020 18:54:58 +0000 (-0500) Subject: [libc++] Revert to previous implementation of __has_rebind X-Git-Tag: llvmorg-12-init~12937 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30cbdcb5c3694e2e6c4647ce88df9e3692bf90cf;p=platform%2Fupstream%2Fllvm.git [libc++] Revert to previous implementation of __has_rebind The new implementation introduced in 5b1e5b43 broke the bot running GCC 5. --- diff --git a/libcxx/include/memory b/libcxx/include/memory index 9d56e81..bea55d6 100644 --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -841,12 +841,16 @@ struct __pointer_traits_difference_type<_Ptr, true> typedef _LIBCPP_NODEBUG_TYPE typename _Ptr::difference_type type; }; -template -struct __has_rebind : false_type {}; - template -struct __has_rebind<_Tp, _Up, - typename __void_t >::type> : true_type {}; +struct __has_rebind +{ +private: + struct __two {char __lx; char __lxx;}; + template static __two __test(...); + template static char __test(typename _Xp::template rebind<_Up>* = 0); +public: + static const bool value = sizeof(__test<_Tp>(0)) == 1; +}; template ::value> struct __pointer_traits_rebind