summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc
blob: bce8da7f6cf933666709db3f36065e7fe6cd0dd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-do run { target c++17 xfail *-*-* } }
// { dg-require-debug-mode "" }

#include <unordered_set>
#include <algorithm>
#include <testsuite_hooks.h>

using test_type = std::unordered_multiset<int>;

void
test01()
{
  test_type c0{ 1, 1, 2, 2, 3, 3 };
  test_type c1 = c0;

  auto it = c1.find(2);
  VERIFY( *it == 2 );

  c0.merge(c1);

  VERIFY( it != c1.end() ); // Invalid iterator.
}

int
main()
{
  test01();
}