| 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 | // mapped_type& operator[](const key_type& k); |
| 18 | |
| 19 | // https://llvm.org/PR16542 |
| 20 | |
| 21 | #include <cstddef> |
| 22 | #include <tuple> |
| 23 | #include <unordered_map> |
| 24 | |
| 25 | struct my_hash { |
| 26 | std::size_t operator()(const std::tuple<int, int>&) const { return 0; } |
| 27 | }; |
| 28 | |
| 29 | int main(int, char**) { |
| 30 | std::unordered_map<std::tuple<int, int>, std::size_t, my_hash> m; |
| 31 | m[std::make_tuple(args: 2, args: 3)] = 7; |
| 32 | |
| 33 | return 0; |
| 34 | } |
| 35 | |