-
- Downloads
[libc++] Fix tuple assignment from types derived from a tuple-like
The implementation of tuple's constructors and assignment operators currently diverges from the way the Standard specifies them, which leads to subtle cases where the behavior is not as specified. In particular, a class derived from a tuple-like type (e.g. pair) can't be assigned to a tuple with corresponding members, when it should. This commit re-implements the assignment operators (BUT NOT THE CONSTRUCTORS) in a way much closer to the specification to get rid of this bug. Most of the tests have been stolen from Eric's patch https://reviews.llvm.org/D27606. As a fly-by improvement, tests for noexcept correctness have been added to all overloads of operator=. We should tackle the same issue for the tuple constructors in a future patch - I'm just trying to make progress on fixing this long-standing bug. PR17550 rdar://15837420 Differential Revision: https://reviews.llvm.org/D50106
Showing
- libcxx/include/tuple 130 additions, 73 deletionslibcxx/include/tuple
- libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.assign/array.extension.pass.cpp 104 additions, 0 deletions...s/tuple/tuple.tuple/tuple.assign/array.extension.pass.cpp
- libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.assign/tuple_array_template_depth.pass.cpp 0 additions, 0 deletions...le.tuple/tuple.assign/tuple_array_template_depth.pass.cpp
- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp 30 additions, 3 deletions...lities/tuple/tuple.tuple/tuple.assign/const_pair.pass.cpp
- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp 21 additions, 1 deletion...ties/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp
- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp 21 additions, 1 deletion...ties/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp
- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp 15 additions, 1 deletion...td/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp
- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/derived_from_tuple_like.pass.cpp 120 additions, 0 deletions...tuple.tuple/tuple.assign/derived_from_tuple_like.pass.cpp
- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/laziness.pass.cpp 77 additions, 0 deletions...tilities/tuple/tuple.tuple/tuple.assign/laziness.pass.cpp
- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp 23 additions, 4 deletions...td/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp
- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp 31 additions, 7 deletions...ilities/tuple/tuple.tuple/tuple.assign/move_pair.pass.cpp
- libcxx/test/support/propagate_value_category.hpp 153 additions, 0 deletionslibcxx/test/support/propagate_value_category.hpp
Loading
Please register or sign in to comment