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_map> |
11 | |
12 | // Check that std::unordered_set 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 | |
17 | template <class T> |
18 | struct Hash { |
19 | std::size_t operator () (const T& lhs) const { return 0; } |
20 | |
21 | Hash () {} |
22 | private: |
23 | Hash (const Hash &); // declared but not defined |
24 | }; |
25 | |
26 | |
27 | int main(int, char**) { |
28 | std::unordered_set<int, Hash<int> > m; |
29 | |
30 | return 0; |
31 | } |
32 | |