Fix return type of std::tuple_cat.
When the arguments to tuple cat were const, the const was incorrectly
propagated into the type of the resulting tuple. For example:
const std::tuple<int> t(42);
auto r = std::tuple_cat(t, t);
// Incorrect! should be std::tuple<int, int>.
static_assert(is_same_v<decltype(r), std::tuple<const int, const int>>);
llvm-svn: 359255
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 7e528bc4ce51daae5b90bf641f15ea564901de8b
diff --git a/include/tuple b/include/tuple
index 335e59e..7437d5c 100644
--- a/include/tuple
+++ b/include/tuple
@@ -1211,7 +1211,7 @@
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0>
{
typedef typename __tuple_cat_type<tuple<_Types...>,
- typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type>::type
+ typename __make_tuple_types<typename __uncvref<_Tuple0>::type>::type>::type
type;
};
@@ -1220,7 +1220,7 @@
: public __tuple_cat_return_1<
typename __tuple_cat_type<
tuple<_Types...>,
- typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type
+ typename __make_tuple_types<typename __uncvref<_Tuple0>::type>::type
>::type,
__tuple_like<typename remove_reference<_Tuple1>::type>::value,
_Tuple1, _Tuples...>