gcc/libstdc++-v3/testsuite/20_util
Edward Smith-Rowland 3a66e68ad9 Implement C++20 p0202 - Add Constexpr Modifiers to Functions in <algorithm> and <utility> Headers.
2019-08-01  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement C++20 p0202 - Add Constexpr Modifiers to Functions
	in <algorithm> and <utility> Headers.
	Implement C++20 p1023 - constexpr comparison operators for std::array.
	* include/bits/algorithmfwd.h (all_of, any_of, binary_search, copy,
	copy_backward, copy_if, copy_n, equal_range, fill, find_end,
	find_if_not, includes, is_heap, is_heap_until, is_partitioned,
	is_permutation, is_sorted, is_sorted_until, iter_swap, lower_bound,
	none_of, partition_copy, partition_point, remove, remove_if,
	remove_copy, remove_copy_if, replace_copy, replace_copy_if,
	reverse_copy, rotate_copy, uunique, upper_bound, adjacent_find, count,
	count_if, equal, find, find_first_of, find_if, for_each, generate,
	generate_n, lexicographical_compare, merge, mismatch, replace,
	replace_if, search, search_n, set_difference, set_intersection,
	set_symmetric_difference, set_union, transform, unique_copy):
	Mark constexpr.
	* include/bits/cpp_type_traits.h (__miter_base): Mark constexpr.
	* include/bits/predefined_ops.h (_Iter_less_val::operator(),
	_Val_less_iter::operator(), _Iter_equal_to_iter::operator(),
	_Iter_equal_to_val::operator(), _Iter_equals_val::operator()):
	 Use const ref instead of ref arg;
	(_Iter_less_val, __iter_less_val, _Val_less_iter, __val_less_iter,
	__iter_equal_to_iter, __iter_equal_to_val, __iter_comp_val,
	_Iter_comp_val, _Val_comp_iter, __val_comp_iter, __iter_equals_val,
	_Iter_equals_iter, __iter_comp_iter, _Iter_pred, __pred_iter,
	_Iter_comp_to_val, __iter_comp_val, _Iter_comp_to_iter,
	__iter_comp_iter): Mark constexpr.
	* include/bits/stl_algo.h (__find_if, __find_if_not, __find_if_not_n,
	__search, __search_n_aux, __search_n, __find_end, find_end, all_of,
	none_of, any_of, find_if_not, is_partitioned, partition_point,
	__remove_copy_if, remove_copy, remove_copy_if, copy_if, __copy_n,
	copy_n, partition_copy, __remove_if, remove, remove_if, __adjacent_find,
	__unique, unique, __unique_copy, reverse_copy, rotate_copy,
	__unguarded_linear_insert, __insertion_sort, __unguarded_insertion_sort,
	__final_insertion_sort, lower_bound, __upper_bound, upper_bound,
	__equal_range, equal_range, binary_search, __includes, includes,
	__next_permutation, __prev_permutation, __replace_copy_if, replace_copy,
	replace_copy_if, __count_if, is_sorted, __is_sorted_until,
	is_sorted_until, __is_permutation, is_permutation, for_each, find,
	find_if, find_first_of, adjacent_find, count, count_if, search,
	search_n, transform, replace, replace_if, generate, generate_n,
	unique_copy, __merge, merge, __set_union, set_union, __set_intersection,
	set_intersection, __set_difference, set_difference,
	__set_symmetric_difference, set_symmetric_difference):  Mark constexpr.
	* include/bits/stl_algobase.h (__memmove, __memcmp): New maybe constexpr
	wrappers around __builtin_memmove and __builtin_memcmp
	respectively;
	(__niter_base, __niter_wrap, __copy_m, __copy_move_a, __copy_move_a2,
	copy, move, __copy_move_b, __copy_move_backward_a,
	__copy_move_backward_a2, copy_backward, move_backward, __fill_a, fill,
	__fill_n_a, fill_n, equal, __lc_rai::__newlast1, __lc_rai::__cnd2,
	__lexicographical_compare_impl, __lexicographical_compare,
	__lexicographical_compare<true>::__lc, __lexicographical_compare_aux,
	__lower_bound, lower_bound, equal, __equal4, lexicographical_compare,
	__mismatch, mismatch, __is_heap_until, __is_heap, is_heap_until,
	is_heap): Mark constexpr.
	* include/bits/stl_heap.h (__is_heap_until, __is_heap, is_heap_until,
	is_heap): Mark constexpr.
	* include/bits/stl_iterator.h (__niter_base, __miter_base): Mark constexpr.
	* include/std/array: Make comparison ops constexpr.
	* include/std/utility: Make exchange constexpr.
	* include/std/version (__cpp_lib_constexpr_algorithms): New macro.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust.
	* testsuite/23_containers/array/tuple_interface/
	tuple_element_neg.cc: Adjust.
	* testsuite/20_util/exchange/constexpr.cc: New.
	* testsuite/23_containers/array/comparison_operators/constexpr.cc: New.
	* testsuite/25_algorithms/constexpr_macro.cc: New.
	* testsuite/25_algorithms/adjacent_find/constexpr.cc: New.
	* testsuite/25_algorithms/all_of/constexpr.cc: New.
	* testsuite/25_algorithms/any_of/constexpr.cc: New.
	* testsuite/25_algorithms/binary_search/constexpr.cc: New.
	* testsuite/25_algorithms/copy/constexpr.cc: New.
	* testsuite/25_algorithms/copy_backward/constexpr.cc: New.
	* testsuite/25_algorithms/copy_if/constexpr.cc: New.
	* testsuite/25_algorithms/copy_n/constexpr.cc: New.
	* testsuite/25_algorithms/count/constexpr.cc: New.
	* testsuite/25_algorithms/count_if/constexpr.cc: New.
	* testsuite/25_algorithms/equal/constexpr.cc: New.
	* testsuite/25_algorithms/equal_range/constexpr.cc: New.
	* testsuite/25_algorithms/fill/constexpr.cc: New.
	* testsuite/25_algorithms/fill_n/constexpr.cc: New.
	* testsuite/25_algorithms/find/constexpr.cc: New.
	* testsuite/25_algorithms/find_end/constexpr.cc: New.
	* testsuite/25_algorithms/find_first_of/constexpr.cc: New.
	* testsuite/25_algorithms/find_if/constexpr.cc: New.
	* testsuite/25_algorithms/find_if_not/constexpr.cc: New.
	* testsuite/25_algorithms/for_each/constexpr.cc: New.
	* testsuite/25_algorithms/generate/constexpr.cc: New.
	* testsuite/25_algorithms/generate_n/constexpr.cc: New.
	* testsuite/25_algorithms/is_heap/constexpr.cc: New.
	* testsuite/25_algorithms/is_heap_until/constexpr.cc: New.
	* testsuite/25_algorithms/is_partitioned/constexpr.cc: New.
	* testsuite/25_algorithms/is_permutation/constexpr.cc: New.
	* testsuite/25_algorithms/is_sorted/constexpr.cc: New.
	* testsuite/25_algorithms/is_sorted_until/constexpr.cc: New.
	* testsuite/25_algorithms/lexicographical_compare/constexpr.cc: New.
	* testsuite/25_algorithms/lower_bound/constexpr.cc: New.
	* testsuite/25_algorithms/merge/constexpr.cc: New.
	* testsuite/25_algorithms/mismatch/constexpr.cc: New.
	* testsuite/25_algorithms/none_of/constexpr.cc: New.
	* testsuite/25_algorithms/partition_copy/constexpr.cc: New.
	* testsuite/25_algorithms/partition_point/constexpr.cc: New.
	* testsuite/25_algorithms/remove/constexpr.cc: New.
	* testsuite/25_algorithms/remove_copy/constexpr.cc: New.
	* testsuite/25_algorithms/remove_copy_if/constexpr.cc: New.
	* testsuite/25_algorithms/remove_if/constexpr.cc: New.
	* testsuite/25_algorithms/replace_copy/constexpr.cc: New.
	* testsuite/25_algorithms/replace_copy_if/constexpr.cc: New.
	* testsuite/25_algorithms/replace_if/constexpr.cc: New.
	* testsuite/25_algorithms/reverse_copy/constexpr.cc: New.
	* testsuite/25_algorithms/rotate_copy/constexpr.cc: New.
	* testsuite/25_algorithms/search/constexpr.cc: New.
	* testsuite/25_algorithms/search_n/constexpr.cc: New.
	* testsuite/25_algorithms/set_difference/constexpr.cc: New.
	* testsuite/25_algorithms/set_intersection/constexpr.cc: New.
	* testsuite/25_algorithms/set_symmetric_difference/constexpr.cc: New.
	* testsuite/25_algorithms/set_union/constexpr.cc: New.
	* testsuite/25_algorithms/transform/constexpr.cc: New.
	* testsuite/25_algorithms/unique/constexpr.cc: New.
	* testsuite/25_algorithms/unique_copy/constexpr.cc: New.
	* testsuite/25_algorithms/upper_bound/constexpr.cc: New.

From-SVN: r273975
2019-08-01 15:25:42 +00:00
..
add_const
add_cv
add_lvalue_reference
add_pointer
add_rvalue_reference
add_volatile
addressof
align
aligned_storage
aligned_union
alignment_of
allocator Fix AIX test failure due to replacement operator delete 2019-06-17 16:51:31 +01:00
allocator_traits Add __gnu_test::NullablePointer utility to testsuite 2019-05-14 12:17:23 +01:00
any trans.c (check_inlining_for_nested_subprog): Quote reserved names. 2019-05-17 11:55:43 -06:00
as_const
assume_aligned
auto_ptr
bad_function_call Fix tests that fail without PCH 2019-06-17 09:18:17 +01:00
bind
bool_constant
common_type/requirements PR libstdc++/89102 implement new common_type rules (P0435R1, P0548R1) 2019-05-07 23:46:39 +01:00
conditional/requirements
decay/requirements
declval/requirements
default_delete PR libstdc++/90388 fix std::hash<unique_ptr<T,D>> bugs 2019-05-10 22:41:16 +01:00
duration PR libstdc++/89102 implement new common_type rules (P0435R1, P0548R1) 2019-05-07 23:46:39 +01:00
duration_cast
enable_if/requirements
enable_shared_from_this
exchange Implement C++20 p0202 - Add Constexpr Modifiers to Functions in <algorithm> and <utility> Headers. 2019-08-01 15:25:42 +00:00
extent
forward
from_chars PR c++/90047 - ICE with enable_if alias template. 2019-04-17 23:32:24 -04:00
function
function_objects Avoid unnecessary inclusion of <stdexcept> header 2019-06-06 16:34:56 +01:00
has_unique_object_representations
has_virtual_destructor
hash PR libstdc++/89629 fix _Hash_bytes for lengths > INT_MAX 2019-03-11 13:46:05 +00:00
headers
in_place
integer_sequence
integral_constant
is_abstract Remove redundant static assertions in [meta.unary.prop] traits 2019-06-06 13:13:47 +01:00
is_aggregate Remove redundant static assertions in [meta.unary.prop] traits 2019-06-06 13:13:47 +01:00
is_arithmetic
is_array
is_assignable
is_base_of
is_bounded_array Add feature test macro for bounded array traits 2019-03-06 15:31:06 +00:00
is_class PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_complete_or_unbounded PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_compound
is_const
is_constant_evaluated
is_constructible PR c++/90532 Ensure __is_constructible(T[]) is false 2019-05-20 12:32:51 +01:00
is_convertible
is_copy_assignable
is_copy_constructible
is_default_constructible PR c++/90532 Ensure __is_constructible(T[]) is false 2019-05-20 12:32:51 +01:00
is_destructible
is_empty Remove redundant static assertions in [meta.unary.prop] traits 2019-06-06 13:13:47 +01:00
is_enum
is_final Remove redundant static assertions in [meta.unary.prop] traits 2019-06-06 13:13:47 +01:00
is_floating_point
is_function PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_fundamental
is_implicitly_default_constructible
is_integral P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
is_invocable
is_literal_type
is_lvalue_reference
is_member_function_pointer
is_member_object_pointer
is_member_pointer
is_move_assignable
is_move_constructible PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_nothrow_assignable
is_nothrow_constructible
is_nothrow_convertible Add __is_nothrow_convertible to fix std::is_nothrow_invocable_r 2019-05-14 15:39:58 +01:00
is_nothrow_copy_assignable
is_nothrow_copy_constructible
is_nothrow_default_constructible
is_nothrow_destructible
is_nothrow_invocable Fix tests that fail with -std=gnu++98 or -std=gnu++11 2019-06-06 13:13:42 +01:00
is_nothrow_move_assignable PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_nothrow_move_constructible
is_nothrow_swappable
is_nothrow_swappable_with
is_null_pointer
is_object
is_pod
is_pointer
is_polymorphic Remove redundant static assertions in [meta.unary.prop] traits 2019-06-06 13:13:47 +01:00
is_reference PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_rvalue_reference
is_same
is_scalar
is_signed
is_standard_layout
is_swappable
is_swappable_with
is_trivial
is_trivially_assignable
is_trivially_constructible PR c++/90532 Ensure __is_constructible(T[]) is false 2019-05-20 12:32:51 +01:00
is_trivially_copy_assignable
is_trivially_copy_constructible
is_trivially_copyable CWG 2094 - volatile scalars are trivially copyable. 2019-05-20 19:10:57 +00:00
is_trivially_default_constructible PR c++/90532 Ensure __is_constructible(T[]) is false 2019-05-20 12:32:51 +01:00
is_trivially_destructible
is_trivially_move_assignable
is_trivially_move_constructible
is_unbounded_array PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_union PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_unsigned
is_void PR libstdc++/71579 assert that type traits are not misused with incomplete types 2019-05-31 11:35:03 +01:00
is_volatile
logical_traits
make_signed/requirements P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
make_unsigned/requirements
memory_resource
monotonic_buffer_resource
move
move_if_noexcept
nonesuch nonesuch is insufficiently useless (lwg2996) 2019-05-14 16:48:27 +01:00
optional Add constexpr to std::optional::value_or(U&&)&& 2019-04-17 14:13:30 +01:00
owner_less
pair
pointer_safety
pointer_traits Constexpr in std::pointer_traits (P1006R1) 2019-03-06 11:32:42 +00:00
polymorphic_allocator Tweak C++2a uses-allocator construction utilities 2019-04-26 14:15:54 +01:00
rank
ratio Improve API docs for <chrono> and <ratio> 2019-05-07 23:46:53 +01:00
raw_storage_iterator
reference_wrapper
remove_all_extents
remove_const
remove_cv
remove_cvref
remove_extent
remove_pointer
remove_reference
remove_volatile
result_of
scoped_allocator Tweak C++2a uses-allocator construction utilities 2019-04-26 14:15:54 +01:00
shared_ptr Fix tests that fail without PCH 2019-06-17 09:18:17 +01:00
specialized_algorithms Synchronize libstdc++ PSTL with upstream LLVM PSTL 2019-06-07 22:01:16 +00:00
steady_clock
synchronized_pool_resource
system_clock
time_point
time_point_cast
to_address
to_chars Define std::chars_format enumeration type 2019-06-26 23:54:38 +01:00
tuple Fix tests that fail without PCH 2019-06-17 09:18:17 +01:00
type_identity/requirements
typeindex
underlying_type/requirements P0340R2 Making std::underlying_type SFINAE-friendly 2019-02-23 21:19:00 +00:00
unique_ptr PR libstdc++/91308 fix constraints on unique_ptr assignment 2019-07-31 15:38:26 +01:00
unsynchronized_pool_resource
unwrap_reference Corrections for C++2a std::unwrap_reference traits 2019-04-23 11:27:14 +01:00
uses_allocator C++2a Utility functions to implement uses-allocator construction (P0591R4) 2019-03-01 13:50:36 +00:00
variant Fix std::variant test for ILP32 targets 2019-05-17 15:13:43 +01:00
void_t
weak_ptr
rel_ops.cc
temporary_buffer.cc
variable_templates_for_traits.cc