[pair] Mark constructors as conditionally noexcept
authorLouis Dionne <ldionne@apple.com>
Tue, 11 Dec 2018 14:22:28 +0000 (14:22 +0000)
committerLouis Dionne <ldionne@apple.com>
Tue, 11 Dec 2018 14:22:28 +0000 (14:22 +0000)
commit9f77b1a1de8a57e6bd21c52f9c48e0f4d8ebac25
tree74c5a07ea01e2745dc250c07f2e455df107b0094
parentbca37ac8b8e1031626d90c48a7522db4cca9c641
[pair] Mark constructors as conditionally noexcept

Summary:
std::tuple marks its constructors as noexcept when the corresponding
memberwise constructors are noexcept too -- this commit improves std::pair
so that it behaves the same.

This is a re-application of r348824, which broke the build in C++03 mode
because a test was marked as supported in C++03 when it shouldn't be.

Note:
I did not add support in the explicit and non-explicit `pair(_Tuple&& __p)`
constructors because those are non-standard extensions, and supporting them
properly is tedious (we have to copy the rvalue-referenceness of the deduced
_Tuple&& onto the result of tuple_element).

<rdar://problem/29537079>

Reviewers: mclow.lists, EricWF

Subscribers: christof, llvm-commits

Differential Revision: https://reviews.llvm.org/D48669

llvm-svn: 348847
libcxx/include/utility
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/U_V.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_first_const_second.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/default.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp [new file with mode: 0644]
libcxx/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp
libcxx/test/support/archetypes.hpp
libcxx/test/support/archetypes.ipp