1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // template <class T1, class T2> struct pair
13 // template<size_t I, class T1, class T2>
14 // typename tuple_element<I, std::pair<T1, T2> >::type&
15 // get(pair<T1, T2>&);
20 #include "test_macros.h"
24 std::pair
<int, int> a
;
26 constexpr S() : a
{1,2}, k(std::get
<0>(a
)) {}
29 constexpr std::pair
<int, int> getP () { return { 3, 4 }; }
35 typedef std::pair
<int, short> P
;
36 P
p(3, static_cast<short>(4));
37 assert(std::get
<0>(p
) == 3);
38 assert(std::get
<1>(p
) == 4);
41 assert(std::get
<0>(p
) == 5);
42 assert(std::get
<1>(p
) == 6);
47 static_assert(S().k
== 1, "");
48 static_assert(std::get
<1>(getP()) == 4, "");