summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/23_containers
diff options
context:
space:
mode:
authorfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-05 20:59:17 +0000
committerfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-05 20:59:17 +0000
commitc51e61e75537f91f203a460a316247f84c17cbb5 (patch)
tree6ae30463ff4ad8d0e4bd5e536d11d54e8cade6c7 /libstdc++-v3/testsuite/23_containers
parent594806f84443d823c72149bf0984958f54def6c5 (diff)
downloadgcc-c51e61e75537f91f203a460a316247f84c17cbb5.tar.gz
2012-01-05 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable_policy.h (_Hashtable_base<>::_M_eq()): protected rather than private, use it... * include/bits/hashtable.h (_Hashtable<>::key_eq()): ... here. * testsuite/23_containers/unordered_set/observers.cc: New. * testsuite/23_containers/unordered_multiset/observers.cc: New. * testsuite/23_containers/unordered_map/observers.cc: New. * testsuite/23_containers/unordered_multimap/observers.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182928 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers')
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/observers.cc30
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multimap/observers.cc30
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_multiset/observers.cc30
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/observers.cc30
4 files changed, 120 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/observers.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/observers.cc
new file mode 100644
index 00000000000..4a6847e5c0b
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/observers.cc
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// 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>
+
+void
+test01()
+{
+ std::unordered_map<int, int> um;
+
+ auto ke = um.key_eq();
+ auto h = um.hash_function();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/observers.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/observers.cc
new file mode 100644
index 00000000000..634bd9d3b68
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/observers.cc
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// 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>
+
+void
+test01()
+{
+ std::unordered_multimap<int, int> um;
+
+ auto ke = um.key_eq();
+ auto h = um.hash_function();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/observers.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/observers.cc
new file mode 100644
index 00000000000..0ea3e5bf0c8
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/observers.cc
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// 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_set>
+
+void
+test01()
+{
+ std::unordered_multiset<int> us;
+
+ auto ke = us.key_eq();
+ auto h = us.hash_function();
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/observers.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/observers.cc
new file mode 100644
index 00000000000..c18b0598464
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/observers.cc
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// 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_set>
+
+void
+test01()
+{
+ std::unordered_set<int> us;
+
+ auto ke = us.key_eq();
+ auto h = us.hash_function();
+}