1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // UNSUPPORTED: c++98, c++03
11
12 // <utility>
13
14 // template <class T1, class T2> struct pair
15
16 // template <class... Args1, class... Args2>
17 // pair(piecewise_construct_t, tuple<Args1...> first_args,
18 // tuple<Args2...> second_args);
19
20 #include <tuple>
21 #include <type_traits>
22 #include <utility>
23
24 #include "archetypes.hpp"
25
26
main()27 int main() {
28 using NonThrowingConvert = NonThrowingTypes::ConvertingType;
29 using ThrowingConvert = NonTrivialTypes::ConvertingType;
30 static_assert(!std::is_nothrow_constructible<std::pair<ThrowingConvert, ThrowingConvert>,
31 std::piecewise_construct_t, std::tuple<int, int>, std::tuple<long, long>>::value, "");
32 static_assert(!std::is_nothrow_constructible<std::pair<NonThrowingConvert, ThrowingConvert>,
33 std::piecewise_construct_t, std::tuple<int, int>, std::tuple<long, long>>::value, "");
34 static_assert(!std::is_nothrow_constructible<std::pair<ThrowingConvert, NonThrowingConvert>,
35 std::piecewise_construct_t, std::tuple<int, int>, std::tuple<long, long>>::value, "");
36 static_assert( std::is_nothrow_constructible<std::pair<NonThrowingConvert, NonThrowingConvert>,
37 std::piecewise_construct_t, std::tuple<int, int>, std::tuple<long, long>>::value, "");
38 }
39