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
10// <unordered_set>
11
12// Check that std::unordered_multiset fails to instantiate if the hash function is
13// not copy-constructible. This is mentioned in LWG issue 2436
14
15#include <unordered_set>
16
17template <class T>
18struct Hash {
19 std::size_t operator () (const T& lhs) const { return 0; }
20
21 Hash () {}
22private:
23 Hash (const Hash &); // declared but not defined
24 };
25
26
27int main(int, char**) {
28 std::unordered_multiset<int, Hash<int> > m;
29
30 return 0;
31}
32

source code of libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/hash_copy_constructible.compile.fail.cpp