Implement P0777: Treating unnecessay decay

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324398 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/tuple b/include/tuple
index 2e19f7c..b3a17e7 100644
--- a/include/tuple
+++ b/include/tuple
@@ -211,7 +211,7 @@
     template <class _Tp,
               class = typename enable_if<
                   __lazy_and<
-                      __lazy_not<is_same<typename decay<_Tp>::type, __tuple_leaf>>
+                      __lazy_not<is_same<typename __uncvref<_Tp>::type, __tuple_leaf>>
                     , is_constructible<_Hp, _Tp>
                     >::value
                 >::type
@@ -293,7 +293,7 @@
     template <class _Tp,
               class = typename enable_if<
                   __lazy_and<
-                        __lazy_not<is_same<typename decay<_Tp>::type, __tuple_leaf>>
+                        __lazy_not<is_same<typename __uncvref<_Tp>::type, __tuple_leaf>>
                       , is_constructible<_Hp, _Tp>
                     >::value
                 >::type
@@ -1383,7 +1383,7 @@
 _LIBCPP_NOEXCEPT_RETURN(
     _VSTD::__apply_tuple_impl(
         _VSTD::forward<_Fn>(__f), _VSTD::forward<_Tuple>(__t),
-        typename __make_tuple_indices<tuple_size_v<decay_t<_Tuple>>>::type{})
+        typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type{})
 )
 
 template <class _Tp, class _Tuple, size_t... _Idx>
@@ -1398,7 +1398,7 @@
 constexpr _Tp make_from_tuple(_Tuple&& __t)
 _LIBCPP_NOEXCEPT_RETURN(
     _VSTD::__make_from_tuple_impl<_Tp>(_VSTD::forward<_Tuple>(__t),
-        typename __make_tuple_indices<tuple_size_v<decay_t<_Tuple>>>::type{})
+        typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type{})
 )
 
 #undef _LIBCPP_NOEXCEPT_RETURN