]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/libcxx/containers/sequences/list/db_iterators_6.pass.cpp
Vendor import of libc++ release_39 branch r276489:
[FreeBSD/FreeBSD.git] / test / libcxx / containers / sequences / list / db_iterators_6.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <list>
11
12 // Decrement iterator prior to begin.
13
14 #define _LIBCPP_DEBUG 1
15 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
16
17 #include <list>
18 #include <cassert>
19 #include <iterator>
20 #include <exception>
21 #include <cstdlib>
22
23 int main()
24 {
25     typedef int T;
26     typedef std::list<T> C;
27     C c(1);
28     C::iterator i = c.end();
29     --i;
30     assert(i == c.begin());
31     --i;
32     assert(false);
33 }