gcc/libstdc++-v3/testsuite/23_containers
Jonathan Wakely e625ccc21a PR libstdc++/85965 move is_invocable assertions again
This is another attempt to reduce how often the assertions are
evaluated, so that code which doesn't try to use the function objects
doesn't need them to be invocable.

For _Rb_tree we access the _M_key_compare object directly, so can't put
the assertions in an accessor function for it. However, every invocation
of _M_key_compare is accompanied by a use of _S_key, so the assertions
can be put in there.  For _Hashtable there are member functions that are
consistently used to obtain a hash code or test for equality, so the
assertions can go in those members.

	PR libstdc++/85965
	* include/bits/hashtable.h (_Hashtable::~_Hashtable()): Remove static
	assertions from the destructor.
	* include/bits/hashtable_policy.h (_Hash_code_base::_M_hash_code):
	Move static_assert for hash function to here.
	(_Hash_table_base::_M_equals): Move static_assert for equality
	predicate to here.
	* include/bits/stl_tree.h (_Rb_tree::_S_value(_Const_Link_type)):
	Remove.
	(_Rb_tree::_S_key(_Const_Link_type)): Move assertions here. Access
	the value directly instead of calling _S_value.
	(_Rb_tree::_S_value(_Const_Base_ptr)): Remove.
	(_Rb_tree::_S_key(_Const_Base_ptr)): Do downcast and forward to
	_S_key(_Const_Link_type).
	* testsuite/23_containers/set/85965.cc: Check construction,
	destruction, assignment and size() do not trigger the assertions.
	* testsuite/23_containers/unordered_set/85965.cc: Likewise.
	* testsuite/23_containers/map/48101_neg.cc: Call find and adjust
	expected errors.
	* testsuite/23_containers/multimap/48101_neg.cc: Likewise.
	* testsuite/23_containers/multiset/48101_neg.cc: Likewise.
	* testsuite/23_containers/set/48101_neg.cc: Likewise.
	* testsuite/23_containers/unordered_map/48101_neg.cc: Likewise.
	* testsuite/23_containers/unordered_multimap/48101_neg.cc: Likewise.
	* testsuite/23_containers/unordered_multiset/48101_neg.cc: Likewise.
	* testsuite/23_containers/unordered_set/48101_neg.cc: Likewise.

From-SVN: r271323
2019-05-17 15:13:32 +01:00
..
array Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
bitset Update copyright years. 2019-01-01 13:31:55 +01:00
deque Move from state of allocators (LWG2593) 2019-05-17 04:55:37 +00:00
forward_list Move from state of allocators (LWG2593) 2019-05-17 04:55:37 +00:00
headers Update copyright years. 2019-01-01 13:31:55 +01:00
list Move from state of allocators (LWG2593) 2019-05-17 04:55:37 +00:00
map PR libstdc++/85965 move is_invocable assertions again 2019-05-17 15:13:32 +01:00
multimap PR libstdc++/85965 move is_invocable assertions again 2019-05-17 15:13:32 +01:00
multiset PR libstdc++/85965 move is_invocable assertions again 2019-05-17 15:13:32 +01:00
priority_queue LWG 2537 fix priority_queue constructors to establish invariant 2019-02-14 14:10:19 +00:00
queue PR libstdc++/89128 add deduction guides for container adaptors 2019-02-05 22:58:22 +00:00
set PR libstdc++/85965 move is_invocable assertions again 2019-05-17 15:13:32 +01:00
stack PR libstdc++/89128 add deduction guides for container adaptors 2019-02-05 22:58:22 +00:00
unordered_map PR libstdc++/85965 move is_invocable assertions again 2019-05-17 15:13:32 +01:00
unordered_multimap PR libstdc++/85965 move is_invocable assertions again 2019-05-17 15:13:32 +01:00
unordered_multiset PR libstdc++/85965 move is_invocable assertions again 2019-05-17 15:13:32 +01:00
unordered_set PR libstdc++/85965 move is_invocable assertions again 2019-05-17 15:13:32 +01:00
vector Move from state of allocators (LWG2593) 2019-05-17 04:55:37 +00:00