tuple was accidentally lacking a valid copy assignment operator. It went undetected because I had failed to test assigning from a const lvalue. This fixes http://llvm.org/bugs/show_bug.cgi?id=11921
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@150613 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b04ad4162d
commit
2848444954
@ -500,6 +500,14 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
|||||||
return *this;
|
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
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(__tuple_impl& __t)
|
void swap(__tuple_impl& __t)
|
||||||
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
||||||
|
@ -42,7 +42,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
typedef std::tuple<int, char, std::string> T;
|
typedef std::tuple<int, char, std::string> T;
|
||||||
T t0(2, 'a', "some text");
|
const T t0(2, 'a', "some text");
|
||||||
T t;
|
T t;
|
||||||
t = t0;
|
t = t0;
|
||||||
assert(std::get<0>(t) == 2);
|
assert(std::get<0>(t) == 2);
|
||||||
|
@ -39,7 +39,7 @@ int main()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
typedef std::tuple<int, char, std::string> T;
|
typedef std::tuple<int, char, std::string> T;
|
||||||
T t0(2, 'a', "some text");
|
const T t0(2, 'a', "some text");
|
||||||
T t = t0;
|
T t = t0;
|
||||||
assert(std::get<0>(t) == 2);
|
assert(std::get<0>(t) == 2);
|
||||||
assert(std::get<1>(t) == 'a');
|
assert(std::get<1>(t) == 'a');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user