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