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_set>
12
13// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
14// class Alloc = allocator<Value>>
15// class unordered_set
16
17// unordered_set(unordered_set&& u, const allocator_type& a);
18
19// Validate whether the operation properly guards against ADL-hijacking operator&
20
21#include <unordered_set>
22
23#include "test_allocator.h"
24#include "test_macros.h"
25#include "operator_hijacker.h"
26
27void test() {
28 using A = test_allocator<operator_hijacker>;
29 using H = std::hash<operator_hijacker>;
30 using P = std::equal_to<operator_hijacker>;
31
32 const A a;
33 std::unordered_set<operator_hijacker, H, P, A> so;
34 std::unordered_set<operator_hijacker, H, P, A> s(std::move(so), a);
35}
36

source code of libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.addressof.compile.pass.cpp