| 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 | // UNSUPPORTED: c++03 |
| 10 | |
| 11 | // <unordered_map> |
| 12 | |
| 13 | // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, |
| 14 | // class Alloc = allocator<pair<const Key, T>>> |
| 15 | // class unordered_multimap |
| 16 | |
| 17 | // unordered_multimap(unordered_map&& u, const allocator_type& a); |
| 18 | |
| 19 | // Validate whether the operation properly guards against ADL-hijacking operator& |
| 20 | |
| 21 | #include <unordered_map> |
| 22 | |
| 23 | #include "test_macros.h" |
| 24 | #include "operator_hijacker.h" |
| 25 | |
| 26 | #include "test_allocator.h" |
| 27 | #include "min_allocator.h" |
| 28 | |
| 29 | void test() { |
| 30 | using A = test_allocator<std::pair<const operator_hijacker, operator_hijacker>>; |
| 31 | using C = |
| 32 | std::unordered_multimap<operator_hijacker, |
| 33 | operator_hijacker, |
| 34 | std::hash<operator_hijacker>, |
| 35 | std::equal_to<operator_hijacker>, |
| 36 | A>; |
| 37 | |
| 38 | C mo; |
| 39 | C m(std::move(mo), A()); |
| 40 | } |
| 41 | |