Skip to content

Commit 0036211

Browse files
committed
Also update __gnu_cxx::hash_XXX after (llvm#151951)
Addressing report: llvm#151951 (comment)
1 parent 70bd610 commit 0036211

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

libcxx/include/ext/hash_map

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public:
472472
const hasher& __hf,
473473
const key_equal& __eql,
474474
const allocator_type& __a);
475-
_LIBCPP_HIDE_FROM_ABI hash_map(const hash_map& __u);
475+
_LIBCPP_HIDE_FROM_ABI hash_map(const hash_map& __u) = default;
476476

477477
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const { return allocator_type(__table_.__node_alloc()); }
478478

@@ -569,12 +569,6 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map(
569569
insert(__first, __last);
570570
}
571571

572-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
573-
hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map(const hash_map& __u) : __table_(__u.__table_) {
574-
__table_.__rehash_unique(__u.bucket_count());
575-
insert(__u.begin(), __u.end());
576-
}
577-
578572
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
579573
typename hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
580574
hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k) {
@@ -696,7 +690,7 @@ public:
696690
const hasher& __hf,
697691
const key_equal& __eql,
698692
const allocator_type& __a);
699-
_LIBCPP_HIDE_FROM_ABI hash_multimap(const hash_multimap& __u);
693+
_LIBCPP_HIDE_FROM_ABI hash_multimap(const hash_multimap& __u) = default;
700694

701695
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const { return allocator_type(__table_.__node_alloc()); }
702696

@@ -786,9 +780,6 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(
786780
insert(__first, __last);
787781
}
788782

789-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
790-
hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(const hash_multimap& __u) : __table_(__u.__table_) {}
791-
792783
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
793784
template <class _InputIterator>
794785
inline void hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) {

libcxx/include/ext/hash_set

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public:
265265
const hasher& __hf,
266266
const key_equal& __eql,
267267
const allocator_type& __a);
268-
_LIBCPP_HIDE_FROM_ABI hash_set(const hash_set& __u);
268+
_LIBCPP_HIDE_FROM_ABI hash_set(const hash_set& __u) = default;
269269

270270
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const { return allocator_type(__table_.__node_alloc()); }
271271

@@ -355,12 +355,6 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(
355355
insert(__first, __last);
356356
}
357357

358-
template <class _Value, class _Hash, class _Pred, class _Alloc>
359-
hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(const hash_set& __u) : __table_(__u.__table_) {
360-
__table_.__rehash_unique(__u.bucket_count());
361-
insert(__u.begin(), __u.end());
362-
}
363-
364358
template <class _Value, class _Hash, class _Pred, class _Alloc>
365359
template <class _InputIterator>
366360
inline void hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) {
@@ -445,7 +439,7 @@ public:
445439
const hasher& __hf,
446440
const key_equal& __eql,
447441
const allocator_type& __a);
448-
_LIBCPP_HIDE_FROM_ABI hash_multiset(const hash_multiset& __u);
442+
_LIBCPP_HIDE_FROM_ABI hash_multiset(const hash_multiset& __u) = default;
449443

450444
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const { return allocator_type(__table_.__node_alloc()); }
451445

@@ -533,12 +527,6 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(
533527
insert(__first, __last);
534528
}
535529

536-
template <class _Value, class _Hash, class _Pred, class _Alloc>
537-
hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(const hash_multiset& __u) : __table_(__u.__table_) {
538-
__table_.__rehash_multi(__u.bucket_count());
539-
insert(__u.begin(), __u.end());
540-
}
541-
542530
template <class _Value, class _Hash, class _Pred, class _Alloc>
543531
template <class _InputIterator>
544532
inline void hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, _InputIterator __last) {

0 commit comments

Comments
 (0)