Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions libcxx/include/ext/hash_map
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(
}

template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(const hash_multimap& __u) : __table_(__u.__table_) {
__table_.__rehash_multi(__u.bucket_count());
insert(__u.begin(), __u.end());
}
hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(const hash_multimap& __u) : __table_(__u.__table_) {}

template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
Expand Down
27 changes: 27 additions & 0 deletions libcxx/test/extensions/gnu/hash_multimap/copy.pass.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// ADDITIONAL_COMPILE_FLAGS: -Wno-deprecated

// hash_multimap::hash_multimap(const hash_multimap&)

#include <cassert>
#include <ext/hash_map>

int main(int, char**) {
__gnu_cxx::hash_multimap<int, int> map;

map.insert(std::make_pair(1, 1));
map.insert(std::make_pair(1, 1));

auto map2 = map;

assert(map2.size() == 2);

return 0;
}
Loading