PR69240 Define inequality operators for <random> param types
[official-gcc.git] / libstdc++-v3 / testsuite / 20_util / pair / 40925.cc
blobba9f8d81d394a07852a0d2e24f5e1cd442b73c90
1 // { dg-do compile { target c++11 } }
3 // Copyright (C) 2009-2017 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 #include <utility>
22 struct X
24 explicit X(int, int) { }
26 private:
27 X(const X&) = delete;
30 struct move_only
32 move_only() { }
33 move_only(move_only&&) { }
35 private:
36 move_only(const move_only&) = delete;
39 // libstdc++/40925
40 void test01()
42 int *ip = 0;
43 int X::*mp = 0;
45 std::pair<int*, int*> p1(0, 0);
46 std::pair<int*, int*> p2(ip, 0);
47 std::pair<int*, int*> p3(0, ip);
48 std::pair<int*, int*> p4(ip, ip);
50 std::pair<int X::*, int*> p5(0, 0);
51 std::pair<int X::*, int X::*> p6(mp, 0);
52 std::pair<int X::*, int X::*> p7(0, mp);
53 std::pair<int X::*, int X::*> p8(mp, mp);
55 std::pair<int*, move_only> p9(0, move_only());
56 std::pair<int X::*, move_only> p10(0, move_only());
57 std::pair<move_only, int*> p11(move_only(), 0);
58 std::pair<move_only, int X::*> p12(move_only(), 0);
60 std::pair<int*, move_only> p13(ip, move_only());
61 std::pair<int X::*, move_only> p14(mp, move_only());
62 std::pair<move_only, int*> p15(move_only(), ip);
63 std::pair<move_only, int X::*> p16(move_only(), mp);
65 std::pair<move_only, move_only> p17{move_only(), move_only()};