diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-12 12:18:06 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-12 12:18:06 +0000 |
commit | 1bbff52e3f2ab27df2701942b7c88e635d91840b (patch) | |
tree | 481d2abf3380f5c27a7cc9197b9f4117bd8a5b19 /libstdc++-v3/testsuite/23_containers/unordered_map/requirements | |
parent | 06a9142d1989f94d9ee052756c2558a139193f6d (diff) | |
download | gcc-1bbff52e3f2ab27df2701942b7c88e635d91840b.tar.gz |
2012-04-12 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/52942
* include/bits/stl_function.h (_Identity, _Select1st, _Select2nd):
In C++11 mode do not derive from std::unary_function.
* include/ext/functional (identity, select1st, select2nd): Adjust.
* testsuite/23_containers/unordered_map/requirements/52942.cc: New.
* testsuite/23_containers/unordered_set/requirements/52942.cc: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186375 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers/unordered_map/requirements')
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_map/requirements/52942.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/52942.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/52942.cc new file mode 100644 index 00000000000..bf05fab0d28 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/52942.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without Pred the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <unordered_map> +#include <functional> + +struct TFoo {}; + +struct TFoo_hash +{ + std::size_t operator()(const TFoo &) const { return 0; } +}; + +void f1(std::unordered_map<TFoo, int, TFoo_hash> &) {} + +void f2() +{ + std::unordered_map<TFoo, int, TFoo_hash> map1; + std::bind(f1, std::ref(map1)); +} |