From: Eric Fiselier Date: Fri, 23 Mar 2018 23:42:30 +0000 (+0000) Subject: Partially Revert "Workaround GCC bug PR78489 - SFINAE order is not respected." X-Git-Tag: llvmorg-7.0.0-rc1~9762 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd5e6a35bf38ba25edbacbfeb2c964172a704683;p=platform%2Fupstream%2Fllvm.git Partially Revert "Workaround GCC bug PR78489 - SFINAE order is not respected." This partially reverts commit r328261. The GCC bug has been fixed in trunk and has never existed in a released version. Therefore the changes to variant are unneeded. However, the additional tests have been left in place. llvm-svn: 328388 --- diff --git a/libcxx/include/variant b/libcxx/include/variant index 6f78e2d..f9098f4 100644 --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -1156,24 +1156,29 @@ public: : __impl(in_place_index<_Ip>, _VSTD::forward<_Arg>(__arg)) {} template _Ip2 = _Ip, - class _Tp = variant_alternative_t<_Ip2, variant<_Types...>>, - enable_if_t::value, int> = 0> + class = enable_if_t<(_Ip < sizeof...(_Types)), int>, + class _Tp = variant_alternative_t<_Ip, variant<_Types...>>, + enable_if_t, int> = 0> inline _LIBCPP_INLINE_VISIBILITY - explicit constexpr variant(in_place_index_t<_Ip>, - _Args&&... __args) - noexcept(is_nothrow_constructible_v<_Tp, _Args...>) + explicit constexpr variant( + in_place_index_t<_Ip>, + _Args&&... __args) noexcept(is_nothrow_constructible_v<_Tp, _Args...>) : __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {} - template _Ip2 = _Ip, - class _Tp = variant_alternative_t<_Ip2, variant<_Types...>>, + template < + size_t _Ip, + class _Up, + class... _Args, + enable_if_t<(_Ip < sizeof...(_Types)), int> = 0, + class _Tp = variant_alternative_t<_Ip, variant<_Types...>>, enable_if_t&, _Args...>, int> = 0> inline _LIBCPP_INLINE_VISIBILITY - explicit constexpr variant(in_place_index_t<_Ip>, initializer_list<_Up> __il, - _Args&&... __args) - noexcept(is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>) + explicit constexpr variant( + in_place_index_t<_Ip>, + initializer_list<_Up> __il, + _Args&&... __args) noexcept( + is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>) : __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {} template <