]>
Commit | Line | Data |
---|---|---|
a945c346 | 1 | // Copyright (C) 2021-2024 Free Software Foundation, Inc. |
33a1e511 FD |
2 | // |
3 | // This file is part of the GNU ISO C++ Library. This library is free | |
4 | // software; you can redistribute it and/or modify it under the | |
5 | // terms of the GNU General Public License as published by the | |
6 | // Free Software Foundation; either version 3, or (at your option) | |
7 | // any later version. | |
8 | ||
9 | // This library is distributed in the hope that it will be useful, | |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | // GNU General Public License for more details. | |
13 | ||
14 | // You should have received a copy of the GNU General Public License along | |
15 | // with this library; see the file COPYING3. If not see | |
16 | // <http://www.gnu.org/licenses/>. | |
17 | ||
18 | // { dg-do run } | |
19 | ||
20 | #include <deque> | |
21 | #include <testsuite_hooks.h> | |
22 | ||
23 | // PR libstdc++/70303 | |
24 | ||
25 | void test01() | |
26 | { | |
27 | typedef typename std::deque<int>::iterator It; | |
28 | It it = It(); | |
29 | VERIFY(it == it); | |
30 | VERIFY(!(it != it)); | |
31 | VERIFY(it - it == 0); | |
32 | VERIFY(!(it < it)); | |
33 | VERIFY(!(it > it)); | |
34 | VERIFY(it <= it); | |
35 | VERIFY(it >= it); | |
36 | ||
37 | typedef typename std::deque<int>::const_iterator CIt; | |
38 | CIt cit = CIt(); | |
39 | VERIFY(cit == cit); | |
40 | VERIFY(!(cit != cit)); | |
41 | VERIFY(cit - cit == 0); | |
42 | VERIFY(!(cit < cit)); | |
43 | VERIFY(!(cit > cit)); | |
44 | VERIFY(cit <= cit); | |
45 | VERIFY(cit >= cit); | |
46 | ||
47 | VERIFY(it == cit); | |
48 | VERIFY(!(it != cit)); | |
49 | VERIFY(cit == it); | |
50 | VERIFY(!(cit != it)); | |
51 | VERIFY(it - cit == 0); | |
52 | VERIFY(cit - it == 0); | |
53 | VERIFY(!(it < cit)); | |
54 | VERIFY(!(it > cit)); | |
55 | VERIFY(it <= cit); | |
56 | VERIFY(it >= cit); | |
57 | VERIFY(!(cit < it)); | |
58 | VERIFY(!(cit > it)); | |
59 | VERIFY(cit <= it); | |
60 | VERIFY(cit >= it); | |
61 | } | |
62 | ||
63 | int main() | |
64 | { | |
65 | test01(); | |
66 | return 0; | |
67 | } |