gcc/libstdc++-v3/testsuite/23_containers/unordered_set
Jonathan Wakely eca833b812 libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102)
When given a type which can convert to any container-like type, the
C(const C&) copy constructor and C(const C::_Base&) converting
constructor are ambiguous. This change replaces the converting
constructor's parameter with a reference_wrapper-like type so that
calling that constructor requires an additional user-defined conversion.
This gives it a lower rank than the copy constructor, avoiding the
ambiguity.

While testing this change I discovered that __gnu_debug::forward_list
doesn't have a convering constructor from the std::forward_list base, so
this adds it.

We should probably consider whether the converting constructors should
be 'explicit' but I'm not changing that now.

libstdc++-v3/ChangeLog:

	PR libstdc++/90102
	* include/debug/deque (deque(const _Base&)): Replace parameter
	with a struct that wraps a const _Base&.
	* include/debug/forward_list (forward_list(_Base_ref)): New
	constructor.
	* include/debug/list (list(const _Base&)): Replace parameter
	with a struct that wraps a const _Base&.
	* include/debug/map.h (map(const _Base&)): Likewise.
	* include/debug/multimap.h (multimap(const _Base&)): Likewise.
	* include/debug/multiset.h (multiset(const _Base&)): Likewise.
	* include/debug/set.h (set(const _Base&)): Likewise.
	* include/debug/unordered_map (unordered_map(const _Base&))
	(unordered_multimap(const _Base&)): Likewise.
	* include/debug/unordered_set (unordered_set(const _Base&))
	(unordered_multiset(const _Base&)): Likewise.
	* testsuite/23_containers/vector/cons/destructible_debug_neg.cc:
	Adjust dg-error line number.
	* include/debug/vector (vector(const _Base&)): Likewise.
	* testsuite/23_containers/deque/debug/90102.cc: New test.
	* testsuite/23_containers/forward_list/debug/90102.cc: New test.
	* testsuite/23_containers/list/debug/90102.cc: New test.
	* testsuite/23_containers/map/debug/90102.cc: New test.
	* testsuite/23_containers/multimap/debug/90102.cc: New test.
	* testsuite/23_containers/multiset/debug/90102.cc: New test.
	* testsuite/23_containers/set/debug/90102.cc: New test.
	* testsuite/23_containers/unordered_map/debug/90102.cc: New test.
	* testsuite/23_containers/unordered_multimap/debug/90102.cc: New test.
	* testsuite/23_containers/unordered_multiset/debug/90102.cc: New test.
	* testsuite/23_containers/unordered_set/debug/90102.cc: New test.
	* testsuite/23_containers/vector/debug/90102.cc: New test.
2020-06-02 18:13:33 +01:00
..
allocator libstdc++: Change compile-only test to run 2020-03-10 09:47:15 +00:00
buckets
cons
debug libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102) 2020-06-02 18:13:33 +01:00
erase
hash_policy
insert
max_load_factor
modifiers Library-side tests for parenthesized aggregate init 2020-03-31 17:07:52 +03:00
operations
operators libstdc++: Improve unordered containers == operator (PR 91263) 2020-01-16 14:39:05 +00:00
requirements
48101-2_neg.cc
48101-3_neg.cc
48101_neg.cc
55043.cc
56267-2.cc
56267.cc
56278.cc
61143.cc
63456.cc
85965.cc
92124.cc
erasure.cc libstdc++: Improve tests for __cpp_lib_erase_if macro 2020-04-22 07:25:02 +01:00
final_hash.cc
init-list.cc
instantiation_neg.cc
observers.cc
pmr_typedefs.cc
pmr_typedefs_debug.cc
range_access.cc