1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class T1, class T2> struct pair
14 // template<size_t I, class T1, class T2>
15 // typename tuple_element<I, std::pair<T1, T2> >::type&
16 // get(pair<T1, T2>&);
21 #include "test_macros.h"
25 std::pair<int, int> a;
27 constexpr S() : a{1,2}, k(std::get<0>(a)) {}
30 constexpr std::pair<int, int> getP () { return { 3, 4 }; }
36 typedef std::pair<int, short> P;
37 P p(3, static_cast<short>(4));
38 assert(std::get<0>(p) == 3);
39 assert(std::get<1>(p) == 4);
42 assert(std::get<0>(p) == 5);
43 assert(std::get<1>(p) == 6);
48 static_assert(S().k == 1, "");
49 static_assert(std::get<1>(getP()) == 4, "");