PR 71181 Avoid rehash after reserve
Jonathan Wakely
jwakely@redhat.com
Tue Jun 14 12:25:00 GMT 2016
>diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/hash_policy/71181.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/hash_policy/71181.cc
>new file mode 100644
>index 0000000..e0c0259
>--- /dev/null
>+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/hash_policy/71181.cc
>@@ -0,0 +1,63 @@
>+// Copyright (C) 2016 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 even 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/>.
>+//
>+// { dg-options "-std=gnu++11" }
>+
>+#include <unordered_set>
>+
>+#include <testsuite_hooks.h>
>+
>+template<typename _USet>
>+ void test(std::size_t max)
>+ {
Also it looks like this test could just use int here, not size_t,
because the loop variable is an int (and so it avoids a -Wsign-compare
warning when compiling the test outside the testsuite).
More information about the Libstdc++
mailing list