Debian Codegraph @

libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc

raw
1 // { dg-do run { target c++17 xfail *-*-* } }
2 // { dg-require-debug-mode "" }
3
4 #include <unordered_set>
5 #include <algorithm>
6 #include <testsuite_hooks.h>
7
8 using test_type = std::unordered_multiset<int>;
9
10 void
11 test01()
12 {
13 test_type c0{ 1, 1, 2, 2, 3, 3 };
14 test_type c1 = c0;
15
16 auto it = c1.find(2);
17 VERIFY( *it == 2 );
18
19 c0.merge(std::move(c1));
20
21 VERIFY( it != c1.end() ); // Invalid iterator.
22 }
23
24 int
25 main()
26 {
27 test01();
28 }