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_map |
16 | |
17 | // unordered_map(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 = std::unordered_map<operator_hijacker, operator_hijacker, std::hash<operator_hijacker>, |
32 | std::equal_to<operator_hijacker>, A>; |
33 | |
34 | C mo; |
35 | C m(std::move(mo), A()); |
36 | } |
37 | |