summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/tuple8
-rw-r--r--libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp2
-rw-r--r--libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp2
3 files changed, 10 insertions, 2 deletions
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index d5c6ad0b197..2bdb05fbc09 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -500,6 +500,14 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
return *this;
}
+ _LIBCPP_INLINE_VISIBILITY
+ __tuple_impl&
+ operator=(const __tuple_impl& __t)
+ {
+ __swallow(__tuple_leaf<_Indx, _Tp>::operator=(static_cast<const __tuple_leaf<_Indx, _Tp>&>(__t).get())...);
+ return *this;
+ }
+
_LIBCPP_INLINE_VISIBILITY
void swap(__tuple_impl& __t)
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp
index 45a06aa4bb2..f19043ca338 100644
--- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp
+++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp
@@ -42,7 +42,7 @@ int main()
}
{
typedef std::tuple<int, char, std::string> T;
- T t0(2, 'a', "some text");
+ const T t0(2, 'a', "some text");
T t;
t = t0;
assert(std::get<0>(t) == 2);
diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
index 0f0d1fb9e16..7de3ef61c6d 100644
--- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
+++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/copy.pass.cpp
@@ -39,7 +39,7 @@ int main()
}
{
typedef std::tuple<int, char, std::string> T;
- T t0(2, 'a', "some text");
+ const T t0(2, 'a', "some text");
T t = t0;
assert(std::get<0>(t) == 2);
assert(std::get<1>(t) == 'a');
OpenPOWER on IntegriCloud