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 <class T1, class T2, class U1, class U2> bool operator==(const pair<T1,T2>&, const pair<U1,U2>&);
14 // template <class T1, class T2, class U1, class U2> bool operator!=(const pair<T1,T2>&, const pair<U1,U2>&);
15 // template <class T1, class T2, class U1, class U2> bool operator< (const pair<T1,T2>&, const pair<U1,U2>&);
16 // template <class T1, class T2, class U1, class U2> bool operator> (const pair<T1,T2>&, const pair<U1,U2>&);
17 // template <class T1, class T2, class U1, class U2> bool operator>=(const pair<T1,T2>&, const pair<U1,U2>&);
18 // template <class T1, class T2, class U1, class U2> bool operator<=(const pair<T1,T2>&, const pair<U1,U2>&);
23 #include "test_macros.h"
28 typedef std::pair
<int, short> P1
;
29 typedef std::pair
<long, long> P2
;
30 P1
p1(3, static_cast<short>(4));
40 typedef std::pair
<int, short> P
;
41 P
p1(3, static_cast<short>(4));
42 P
p2(3, static_cast<short>(4));
51 typedef std::pair
<int, short> P
;
52 P
p1(2, static_cast<short>(4));
53 P
p2(3, static_cast<short>(4));
62 typedef std::pair
<int, short> P
;
63 P
p1(3, static_cast<short>(2));
64 P
p2(3, static_cast<short>(4));
73 typedef std::pair
<int, short> P
;
74 P
p1(3, static_cast<short>(4));
75 P
p2(2, static_cast<short>(4));
84 typedef std::pair
<int, short> P
;
85 P
p1(3, static_cast<short>(4));
86 P
p2(3, static_cast<short>(2));
97 typedef std::pair
<int, short> P
;
98 constexpr P
p1(3, static_cast<short>(4));
99 constexpr P
p2(3, static_cast<short>(2));
100 static_assert(!(p1
== p2
), "");
101 static_assert( (p1
!= p2
), "");
102 static_assert(!(p1
< p2
), "");
103 static_assert(!(p1
<= p2
), "");
104 static_assert( (p1
> p2
), "");
105 static_assert( (p1
>= p2
), "");