blob: c319b5c30b2c6c323f0a0b5fb6fb7ff27dc83404 [file] [log] [blame]
Howard Hinnantb66e1c32013-07-04 20:59:16 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <unordered_map>
11
12// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
13// class Alloc = allocator<pair<const Key, T>>>
14// class unordered_map
15
16// mapped_type& operator[](const key_type& k);
17
18// http://llvm.org/bugs/show_bug.cgi?id=16542
19
20#include <unordered_map>
Dan Albert1d4a1ed2016-05-25 22:36:09 -070021
22#ifndef _LIBCPP_HAS_NO_VARIADICS
23
Howard Hinnantb66e1c32013-07-04 20:59:16 +000024#include <tuple>
25
26using namespace std;
27
28struct my_hash
29{
30 size_t operator()(const tuple<int,int>&) const {return 0;}
31};
32
Dan Albert1d4a1ed2016-05-25 22:36:09 -070033#endif
34
Howard Hinnantb66e1c32013-07-04 20:59:16 +000035int main()
36{
Dan Albert1d4a1ed2016-05-25 22:36:09 -070037#ifndef _LIBCPP_HAS_NO_VARIADICS
Howard Hinnantb66e1c32013-07-04 20:59:16 +000038 unordered_map<tuple<int,int>, size_t, my_hash> m;
39 m[make_tuple(2,3)]=7;
Dan Albert1d4a1ed2016-05-25 22:36:09 -070040#endif
Howard Hinnantb66e1c32013-07-04 20:59:16 +000041}