blob: b8db0a35ffc3ef68810f4bc8d753bff0a04bd724 [file] [log] [blame]
Howard Hinnant824c1992013-08-02 17:50:49 +00001//===----------------------------------------------------------------------===//
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// <unordered_map>
11
12// Increment iterator past end.
13
Howard Hinnant5e571422013-08-23 20:10:18 +000014#if _LIBCPP_DEBUG >= 1
Howard Hinnant824c1992013-08-02 17:50:49 +000015
16#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
17
18#include <unordered_map>
19#include <string>
20#include <cassert>
21#include <iterator>
22#include <exception>
23#include <cstdlib>
24
Marshall Clow061d0cc2013-11-26 20:58:02 +000025#include "min_allocator.h"
Howard Hinnant824c1992013-08-02 17:50:49 +000026
27int main()
28{
29 {
30 typedef std::unordered_map<int, std::string> C;
31 C c;
32 c.insert(std::make_pair(1, "one"));
33 C::iterator i = c.begin();
34 ++i;
35 assert(i == c.end());
36 ++i;
37 assert(false);
38 }
39#if __cplusplus >= 201103L
40 {
41 typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
42 min_allocator<std::pair<const int, std::string>>> C;
43 C c;
44 c.insert(std::make_pair(1, "one"));
45 C::iterator i = c.begin();
46 ++i;
47 assert(i == c.end());
48 ++i;
49 assert(false);
50 }
51#endif
52}
53
54#else
55
56int main()
57{
58}
59
60#endif