Howard Hinnant | 824c199 | 2013-08-02 17:50:49 +0000 | [diff] [blame] | 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 | // <unordered_map> |
| 11 | |
| 12 | // Dereference non-dereferenceable iterator. |
| 13 | |
Howard Hinnant | 5e57142 | 2013-08-23 20:10:18 +0000 | [diff] [blame] | 14 | #if _LIBCPP_DEBUG >= 1 |
Howard Hinnant | 824c199 | 2013-08-02 17:50:49 +0000 | [diff] [blame] | 15 | |
| 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 Clow | 061d0cc | 2013-11-26 20:58:02 +0000 | [diff] [blame] | 25 | #include "min_allocator.h" |
Howard Hinnant | 824c199 | 2013-08-02 17:50:49 +0000 | [diff] [blame] | 26 | |
| 27 | int 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.end(); |
| 34 | C::value_type j = *i; |
| 35 | assert(false); |
| 36 | } |
| 37 | #if __cplusplus >= 201103L |
| 38 | { |
| 39 | typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>, |
| 40 | min_allocator<std::pair<const int, std::string>>> C; |
| 41 | C c; |
| 42 | c.insert(std::make_pair(1, "one")); |
| 43 | C::iterator i = c.end(); |
| 44 | C::value_type j = *i; |
| 45 | assert(false); |
| 46 | } |
| 47 | #endif |
| 48 | } |
| 49 | |
| 50 | #else |
| 51 | |
| 52 | int main() |
| 53 | { |
| 54 | } |
| 55 | |
| 56 | #endif |