1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <unordered_set>
10 
11 // Call erase(const_iterator position) with iterator from another container
12 
13 #if _LIBCPP_DEBUG >= 1
14 
15 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
16 
17 #include <unordered_set>
18 #include <cassert>
19 #include <cstdlib>
20 #include <exception>
21 
22 #include "test_macros.h"
23 
main(int,char **)24 int main(int, char**)
25 {
26     {
27     int a1[] = {1, 2, 3};
28     std::unordered_multiset<int> l1(a1, a1+3);
29     std::unordered_multiset<int> l2(a1, a1+3);
30     std::unordered_multiset<int>::const_iterator i = l2.begin();
31     l1.erase(i);
32     assert(false);
33     }
34 }
35 
36 #else
37 
main(int,char **)38 int main(int, char**)
39 {
40 
41   return 0;
42 }
43 
44 #endif
45