* [patch] libstdc++/66055 add missing constructors to unordered containers
@ 2015-05-14 13:51 Jonathan Wakely
2015-05-16 10:36 ` François Dumont
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Wakely @ 2015-05-14 13:51 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 140 bytes --]
Reported by Nathan and fixed by his patch. I added the tests.
Tested powerpc64le-linux, committed to trunk. This should be
backported too.
[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 8924 bytes --]
commit f859cb0e4a369bdade09d5d77f9c8bb78d388294
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu May 14 14:36:20 2015 +0100
2015-05-14 Nathan Myers <ncm@cantrip.org>
Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/66055
* include/std/unordered_map (unordered_map, unordered_multimap): Add
missing constructors.
* include/std/unordered_set (unordered_set, unordered_multiset):
Likewise.
* testsuite/23_containers/unordered_map/cons/66055.cc: New.
* testsuite/23_containers/unordered_multimap/cons/66055.cc: New.
* testsuite/23_containers/unordered_multiset/cons/66055.cc: New.
* testsuite/23_containers/unordered_set/cons/66055.cc: New.
diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h
index 92b75d1..069b859 100644
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -146,6 +146,17 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__n, __hf, __eql, __a)
{ }
+ unordered_map(size_type __n, const allocator_type& __a)
+ : _M_h(__n, hasher(), key_equal(), __a)
+ { }
+
+ explicit
+ unordered_map(size_type __n,
+ const hasher& __hf,
+ const allocator_type& __a)
+ : _M_h(__n, __hf, key_equal(), __a)
+ { }
+
/**
* @brief Builds an %unordered_map from a range.
* @param __first An input iterator.
@@ -861,6 +872,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__n, __hf, __eql, __a)
{ }
+ unordered_multimap(size_type __n, const allocator_type& __a)
+ : _M_h(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multimap(size_type __n,
+ const hasher& __hf,
+ const allocator_type& __a)
+ : _M_h(__n, __hf, key_equal(), __a)
+ { }
+
/**
* @brief Builds an %unordered_multimap from a range.
* @param __first An input iterator.
diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h
index 7a2546c..c91eab8 100644
--- a/libstdc++-v3/include/bits/unordered_set.h
+++ b/libstdc++-v3/include/bits/unordered_set.h
@@ -140,6 +140,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__n, __hf, __eql, __a)
{ }
+ unordered_set(size_type __n, const allocator_type& __a)
+ : _M_h(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_set(size_type __n,
+ const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__n, __hf, key_equal(), __a)
+ { }
+
/**
* @brief Builds an %unordered_set from a range.
* @param __first An input iterator.
@@ -779,6 +789,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__n, __hf, __eql, __a)
{ }
+ unordered_multiset(size_type __n, const allocator_type& __a)
+ : _M_h(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multiset(size_type __n,
+ const hasher& __hf,
+ const allocator_type& __a)
+ : _M_h(__n, __hf, key_equal(), __a)
+ { }
+
/**
* @brief Builds an %unordered_multiset from a range.
* @param __first An input iterator.
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/66055.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/66055.cc
new file mode 100644
index 0000000..0d3e384
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/66055.cc
@@ -0,0 +1,30 @@
+// Copyright (C) 2015 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/>.
+
+// Jonathan Wakely <jwakely@redhat.com>
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+#include <unordered_map>
+
+using test_type = std::unordered_map<int, int>;
+using hasher_type = test_type::hasher;
+using alloc_type = test_type::allocator_type;
+
+test_type h1(10, alloc_type());
+test_type h2(10, hasher_type(), alloc_type());
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/66055.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/66055.cc
new file mode 100644
index 0000000..c4d68ec
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/66055.cc
@@ -0,0 +1,30 @@
+// Copyright (C) 2015 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/>.
+
+// Jonathan Wakely <jwakely@redhat.com>
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+#include <unordered_map>
+
+using test_type = std::unordered_multimap<int, int>;
+using hasher_type = test_type::hasher;
+using alloc_type = test_type::allocator_type;
+
+test_type h1(10, alloc_type());
+test_type h2(10, hasher_type(), alloc_type());
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/66055.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/66055.cc
new file mode 100644
index 0000000..0680951
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/66055.cc
@@ -0,0 +1,30 @@
+// Copyright (C) 2015 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/>.
+
+// Jonathan Wakely <jwakely@redhat.com>
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+#include <unordered_set>
+
+using test_type = std::unordered_multiset<int>;
+using hasher_type = test_type::hasher;
+using alloc_type = test_type::allocator_type;
+
+test_type h1(10, alloc_type());
+test_type h2(10, hasher_type(), alloc_type());
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/66055.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/66055.cc
new file mode 100644
index 0000000..2ead0b1
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/66055.cc
@@ -0,0 +1,30 @@
+// Copyright (C) 2015 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/>.
+
+// Jonathan Wakely <jwakely@redhat.com>
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+#include <unordered_set>
+
+using test_type = std::unordered_set<int>;
+using hasher_type = test_type::hasher;
+using alloc_type = test_type::allocator_type;
+
+test_type h1(10, alloc_type());
+test_type h2(10, hasher_type(), alloc_type());
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] libstdc++/66055 add missing constructors to unordered containers
2015-05-14 13:51 [patch] libstdc++/66055 add missing constructors to unordered containers Jonathan Wakely
@ 2015-05-16 10:36 ` François Dumont
2015-05-16 19:58 ` Jonathan Wakely
0 siblings, 1 reply; 5+ messages in thread
From: François Dumont @ 2015-05-16 10:36 UTC (permalink / raw)
To: Jonathan Wakely, libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1578 bytes --]
On 14/05/2015 15:47, Jonathan Wakely wrote:
> Reported by Nathan and fixed by his patch. I added the tests.
>
> Tested powerpc64le-linux, committed to trunk. This should be
> backported too.
While backporting to debug and profile mode I noticed that those
constructors were not the only missing ones. So here is a patch to
complete them with debug and profile modes.
Moreover this patch:
- Remove explicit keyword on one of the unordered_map constructor,
surely the result of a copy/paste
- Use constructor delegation as proposed by the Standard
- Move code to follow Standard description order, it is easier this way
to check that nothing is missing.
* include/bits/unordered_map.h (unordered_map, unordered_multimap): Add
missing constructors.
* include/bits/unordered_set.h (unordered_set, unordered_multiset):
Likewise.
* include/debug/unordered_map (unordered_map, unordered_multimap): Add
missing constructors.
* include/debug/unordered_set (unordered_set, unordered_multiset):
Likewise.
* include/profile/unordered_map (unordered_map,
unordered_multimap): Add
missing constructors.
* include/profile/unordered_set (unordered_set, unordered_multiset):
Likewise.
* testsuite/23_containers/unordered_map/cons/66055.cc: Add constructor
invocations.
* testsuite/23_containers/unordered_multimap/cons/66055.cc: Likewise.
* testsuite/23_containers/unordered_multiset/cons/66055.cc: Likewise.
* testsuite/23_containers/unordered_set/cons/66055.cc: Likewise.
Ok to commit ?
François
[-- Attachment #2: unordered.patch --]
[-- Type: text/x-patch, Size: 23343 bytes --]
diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h
index 069b859..6ace59d 100644
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -146,17 +146,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__n, __hf, __eql, __a)
{ }
- unordered_map(size_type __n, const allocator_type& __a)
- : _M_h(__n, hasher(), key_equal(), __a)
- { }
-
- explicit
- unordered_map(size_type __n,
- const hasher& __hf,
- const allocator_type& __a)
- : _M_h(__n, __hf, key_equal(), __a)
- { }
-
/**
* @brief Builds an %unordered_map from a range.
* @param __first An input iterator.
@@ -233,6 +222,41 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__l, __n, __hf, __eql, __a)
{ }
+ unordered_map(size_type __n, const allocator_type& __a)
+ : unordered_map(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_map(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_map(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__l, __n, __hf, key_equal(), __a)
+ { }
+
/// Copy assignment operator.
unordered_map&
operator=(const unordered_map&) = default;
@@ -872,16 +896,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__n, __hf, __eql, __a)
{ }
- unordered_multimap(size_type __n, const allocator_type& __a)
- : _M_h(__n, hasher(), key_equal(), __a)
- { }
-
- unordered_multimap(size_type __n,
- const hasher& __hf,
- const allocator_type& __a)
- : _M_h(__n, __hf, key_equal(), __a)
- { }
-
/**
* @brief Builds an %unordered_multimap from a range.
* @param __first An input iterator.
@@ -958,6 +972,41 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__l, __n, __hf, __eql, __a)
{ }
+ unordered_multimap(size_type __n, const allocator_type& __a)
+ : unordered_multimap(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multimap(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multimap(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__l, __n, __hf, key_equal(), __a)
+ { }
+
/// Copy assignment operator.
unordered_multimap&
operator=(const unordered_multimap&) = default;
diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h
index c91eab8..8f9f12b 100644
--- a/libstdc++-v3/include/bits/unordered_set.h
+++ b/libstdc++-v3/include/bits/unordered_set.h
@@ -140,16 +140,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__n, __hf, __eql, __a)
{ }
- unordered_set(size_type __n, const allocator_type& __a)
- : _M_h(__n, hasher(), key_equal(), __a)
- { }
-
- unordered_set(size_type __n,
- const hasher& __hf,
- const allocator_type& __a)
- : unordered_set(__n, __hf, key_equal(), __a)
- { }
-
/**
* @brief Builds an %unordered_set from a range.
* @param __first An input iterator.
@@ -226,6 +216,41 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__l, __n, __hf, __eql, __a)
{ }
+ unordered_set(size_type __n, const allocator_type& __a)
+ : unordered_set(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_set(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_set(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_set(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__l, __n, __hf, key_equal(), __a)
+ { }
+
/// Copy assignment operator.
unordered_set&
operator=(const unordered_set&) = default;
@@ -789,16 +814,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(__n, __hf, __eql, __a)
{ }
- unordered_multiset(size_type __n, const allocator_type& __a)
- : _M_h(__n, hasher(), key_equal(), __a)
- { }
-
- unordered_multiset(size_type __n,
- const hasher& __hf,
- const allocator_type& __a)
- : _M_h(__n, __hf, key_equal(), __a)
- { }
-
/**
* @brief Builds an %unordered_multiset from a range.
* @param __first An input iterator.
@@ -883,6 +898,41 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: _M_h(std::move(__umset._M_h), __a)
{ }
+ unordered_multiset(size_type __n, const allocator_type& __a)
+ : unordered_multiset(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multiset(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multiset(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multiset(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__l, __n, __hf, key_equal(), __a)
+ { }
+
/**
* @brief %Unordered_multiset list assignment operator.
* @param __l An initializer_list.
@@ -891,7 +941,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* in the initializer list @a __l.
*
* Note that the assignment completely changes the %unordered_multiset
- * and that the resulting %unordered_set's size is the same as the number
+ * and that the resulting %unordered_multiset's size is the same as the number
* of elements assigned. Old data may be lost.
*/
unordered_multiset&
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map
index 0525367..41e20d7 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -129,6 +129,44 @@ namespace __debug
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
+ unordered_map(size_type __n, const allocator_type& __a)
+ : unordered_map(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_map(size_type __n,
+ const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_map(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n,
+ const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__l, __n, __hf, key_equal(), __a)
+ { }
+
~unordered_map() = default;
unordered_map&
@@ -550,6 +588,41 @@ namespace __debug
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
+ unordered_multimap(size_type __n, const allocator_type& __a)
+ : unordered_multimap(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multimap(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multimap(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__l, __n, __hf, key_equal(), __a)
+ { }
+
~unordered_multimap() = default;
unordered_multimap&
diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set
index b52268b..1e68461 100644
--- a/libstdc++-v3/include/debug/unordered_set
+++ b/libstdc++-v3/include/debug/unordered_set
@@ -129,6 +129,41 @@ namespace __debug
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
+ unordered_set(size_type __n, const allocator_type& __a)
+ : unordered_set(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_set(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_set(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_set(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__l, __n, __hf, key_equal(), __a)
+ { }
+
~unordered_set() = default;
unordered_set&
@@ -546,6 +581,41 @@ namespace __debug
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
+ unordered_multiset(size_type __n, const allocator_type& __a)
+ : unordered_multiset(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multiset(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multiset(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multiset(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__l, __n, __hf, key_equal(), __a)
+ { }
+
~unordered_multiset() = default;
unordered_multiset&
diff --git a/libstdc++-v3/include/profile/unordered_map b/libstdc++-v3/include/profile/unordered_map
index fdb4550..480faba 100644
--- a/libstdc++-v3/include/profile/unordered_map
+++ b/libstdc++-v3/include/profile/unordered_map
@@ -119,6 +119,41 @@ namespace __profile
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
+ unordered_map(size_type __n, const allocator_type& __a)
+ : unordered_map(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_map(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_map(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_map(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_map(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_map(__l, __n, __hf, key_equal(), __a)
+ { }
+
unordered_map&
operator=(const unordered_map&) = default;
@@ -361,6 +396,41 @@ namespace __profile
const allocator_type& __a = allocator_type())
: _Base(__l, __n, __hf, __eql, __a) { }
+ unordered_multimap(size_type __n, const allocator_type& __a)
+ : unordered_multimap(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multimap(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multimap(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multimap(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multimap(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multimap(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multimap(__l, __n, __hf, key_equal(), __a)
+ { }
+
unordered_multimap&
operator=(const unordered_multimap&) = default;
diff --git a/libstdc++-v3/include/profile/unordered_set b/libstdc++-v3/include/profile/unordered_set
index e1eb1a1..15950b9 100644
--- a/libstdc++-v3/include/profile/unordered_set
+++ b/libstdc++-v3/include/profile/unordered_set
@@ -125,6 +125,41 @@ namespace __profile
: _Base(__l, __n, __hf, __eql, __a)
{ }
+ unordered_set(size_type __n, const allocator_type& __a)
+ : unordered_set(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_set(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_set(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_set(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_set(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_set(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_set(__l, __n, __hf, key_equal(), __a)
+ { }
+
unordered_set&
operator=(const unordered_set&) = default;
@@ -346,6 +381,41 @@ namespace __profile
: _Base(__l, __n, __hf, __eql, __a)
{ }
+ unordered_multiset(size_type __n, const allocator_type& __a)
+ : unordered_multiset(__n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multiset(size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__n, __hf, key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __first, _InputIterator __last,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multiset(__first, __last, __n, hasher(), key_equal(), __a)
+ { }
+
+ template<typename _InputIterator>
+ unordered_multiset(_InputIterator __first, _InputIterator __last,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__first, __last, __n, __hf, key_equal(), __a)
+ { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n,
+ const allocator_type& __a)
+ : unordered_multiset(__l, __n, hasher(), key_equal(), __a)
+ { }
+
+ unordered_multiset(initializer_list<value_type> __l,
+ size_type __n, const hasher& __hf,
+ const allocator_type& __a)
+ : unordered_multiset(__l, __n, __hf, key_equal(), __a)
+ { }
+
unordered_multiset&
operator=(const unordered_multiset&) = default;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/66055.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/66055.cc
index 0d3e384..17efac55 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/66055.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/66055.cc
@@ -28,3 +28,7 @@ using alloc_type = test_type::allocator_type;
test_type h1(10, alloc_type());
test_type h2(10, hasher_type(), alloc_type());
+test_type h3(h1.begin(), h1.end(), 10, alloc_type());
+test_type h4(h1.begin(), h1.end(), 10, hasher_type(), alloc_type());
+test_type h5({ { 1, 1 } }, 10, alloc_type());
+test_type h6({ { 1, 1 } }, 10, hasher_type(), alloc_type());
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/66055.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/66055.cc
index c4d68ec..d99d352 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/66055.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/cons/66055.cc
@@ -28,3 +28,7 @@ using alloc_type = test_type::allocator_type;
test_type h1(10, alloc_type());
test_type h2(10, hasher_type(), alloc_type());
+test_type h3(h1.begin(), h1.end(), 10, alloc_type());
+test_type h4(h1.begin(), h1.end(), 10, hasher_type(), alloc_type());
+test_type h5({ { 1, 1 } }, 10, alloc_type());
+test_type h6({ { 1, 1 } }, 10, hasher_type(), alloc_type());
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/66055.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/66055.cc
index 0680951..7ae17b7 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/66055.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/cons/66055.cc
@@ -28,3 +28,7 @@ using alloc_type = test_type::allocator_type;
test_type h1(10, alloc_type());
test_type h2(10, hasher_type(), alloc_type());
+test_type h3(h1.begin(), h1.end(), 10, alloc_type());
+test_type h4(h1.begin(), h1.end(), 10, hasher_type(), alloc_type());
+test_type h5({ 1, 1 }, 10, alloc_type());
+test_type h6({ 1, 1 }, 10, hasher_type(), alloc_type());
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/66055.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/66055.cc
index 2ead0b1..73e223d 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/cons/66055.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/cons/66055.cc
@@ -28,3 +28,7 @@ using alloc_type = test_type::allocator_type;
test_type h1(10, alloc_type());
test_type h2(10, hasher_type(), alloc_type());
+test_type h3(h1.begin(), h1.end(), 10, alloc_type());
+test_type h4(h1.begin(), h1.end(), 10, hasher_type(), alloc_type());
+test_type h5({ 1, 1 }, 10, alloc_type());
+test_type h6({ 1, 1 }, 10, hasher_type(), alloc_type());
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] libstdc++/66055 add missing constructors to unordered containers
2015-05-16 10:36 ` François Dumont
@ 2015-05-16 19:58 ` Jonathan Wakely
2015-05-17 20:42 ` François Dumont
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Wakely @ 2015-05-16 19:58 UTC (permalink / raw)
To: François Dumont; +Cc: libstdc++, gcc-patches
On 16/05/15 11:39 +0200, François Dumont wrote:
>On 14/05/2015 15:47, Jonathan Wakely wrote:
>>Reported by Nathan and fixed by his patch. I added the tests.
>>
>>Tested powerpc64le-linux, committed to trunk. This should be
>>backported too.
>
>While backporting to debug and profile mode I noticed that those
>constructors were not the only missing ones. So here is a patch to
>complete them with debug and profile modes.
Great, thanks.
>@@ -233,6 +222,41 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
> : _M_h(__l, __n, __hf, __eql, __a)
> { }
>
>+ unordered_map(size_type __n, const allocator_type& __a)
>+ : unordered_map(__n, hasher(), key_equal(), __a)
>+ { }
>+
>+ unordered_map(size_type __n, const hasher& __hf,
>+ const allocator_type& __a)
>+ : unordered_map(__n, __hf, key_equal(), __a)
>+ { }
>+
>+ template<typename _InputIterator>
>+ unordered_map(_InputIterator __first, _InputIterator __last,
>+ size_type __n,
>+ const allocator_type& __a)
>+ : unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
The indentation is inconsistent here, the ctor-initializer-list is
indented further than necessary
>@@ -891,7 +941,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
> * in the initializer list @a __l.
> *
> * Note that the assignment completely changes the %unordered_multiset
>- * and that the resulting %unordered_set's size is the same as the number
>+ * and that the resulting %unordered_multiset's size is the same as the number
> * of elements assigned. Old data may be lost.
Please reformat this to stay below 80 columns.
OK with those two tiny adjustments, thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] libstdc++/66055 add missing constructors to unordered containers
2015-05-16 19:58 ` Jonathan Wakely
@ 2015-05-17 20:42 ` François Dumont
2015-05-19 14:33 ` Jonathan Wakely
0 siblings, 1 reply; 5+ messages in thread
From: François Dumont @ 2015-05-17 20:42 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: libstdc++, gcc-patches
Ok, I just commit fixing some other lines length except those having a
long hyperlink, I didn't want to break those.
François
On 16/05/2015 21:32, Jonathan Wakely wrote:
> On 16/05/15 11:39 +0200, François Dumont wrote:
>> On 14/05/2015 15:47, Jonathan Wakely wrote:
>>> Reported by Nathan and fixed by his patch. I added the tests.
>>>
>>> Tested powerpc64le-linux, committed to trunk. This should be
>>> backported too.
>>
>> While backporting to debug and profile mode I noticed that those
>> constructors were not the only missing ones. So here is a patch to
>> complete them with debug and profile modes.
>
> Great, thanks.
>
>> @@ -233,6 +222,41 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
>> : _M_h(__l, __n, __hf, __eql, __a)
>> { }
>>
>> + unordered_map(size_type __n, const allocator_type& __a)
>> + : unordered_map(__n, hasher(), key_equal(), __a)
>> + { }
>> +
>> + unordered_map(size_type __n, const hasher& __hf,
>> + const allocator_type& __a)
>> + : unordered_map(__n, __hf, key_equal(), __a)
>> + { }
>> +
>> + template<typename _InputIterator>
>> + unordered_map(_InputIterator __first, _InputIterator __last,
>> + size_type __n,
>> + const allocator_type& __a)
>> + : unordered_map(__first, __last, __n, hasher(), key_equal(), __a)
>
> The indentation is inconsistent here, the ctor-initializer-list is
> indented further than necessary
>
>> @@ -891,7 +941,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
>> * in the initializer list @a __l.
>> *
>> * Note that the assignment completely changes the
>> %unordered_multiset
>> - * and that the resulting %unordered_set's size is the same
>> as the number
>> + * and that the resulting %unordered_multiset's size is the
>> same as the number
>> * of elements assigned. Old data may be lost.
>
> Please reformat this to stay below 80 columns.
>
> OK with those two tiny adjustments, thanks!
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] libstdc++/66055 add missing constructors to unordered containers
2015-05-17 20:42 ` François Dumont
@ 2015-05-19 14:33 ` Jonathan Wakely
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Wakely @ 2015-05-19 14:33 UTC (permalink / raw)
To: François Dumont; +Cc: libstdc++, gcc-patches
On 17/05/15 22:21 +0200, François Dumont wrote:
>Ok, I just commit fixing some other lines length except those having a
>long hyperlink, I didn't want to break those.
Yep, thanks. I think we should backport Nathan's patch and your one to
the gcc-5-branch too.
I'll make a note to do that before the 5.2 release.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-05-19 14:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 13:51 [patch] libstdc++/66055 add missing constructors to unordered containers Jonathan Wakely
2015-05-16 10:36 ` François Dumont
2015-05-16 19:58 ` Jonathan Wakely
2015-05-17 20:42 ` François Dumont
2015-05-19 14:33 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).