gcc/libstdc++-v3/testsuite/26_numerics
Jonathan Wakely 9017326e19 libstdc++: Add additional overload of std::lerp [PR101870]
The [cmath.syn] p1 wording about additional overloads sufficient to
handle any arithmetic types also applies to std::lerp. This adds a new
overload of std::lerp that does the required promotions to support
arguments of arbitrary arithmetic types.

A new __promoted_t alias template is added, which the C++17 function
templates std::hypot and std::lerp can use to avoid instantiating the
__promote_3 class template.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/101870
	* include/c_global/cmath (hypot): Use __promoted_t.
	(lerp): Add new overload accepting any arithmetic types.
	* include/ext/type_traits.h (__promoted_t): New alias template.
	* testsuite/26_numerics/lerp.cc: Moved to...
	* testsuite/26_numerics/lerp/1.cc: ...here.
	* testsuite/26_numerics/lerp/constexpr.cc: New test.
	* testsuite/26_numerics/lerp/version.cc: New test.
2021-08-12 19:46:16 +01:00
..
accumulate Update copyright years. 2021-01-04 10:26:59 +01:00
adjacent_difference Update copyright years. 2021-01-04 10:26:59 +01:00
bit Update copyright years. 2021-01-04 10:26:59 +01:00
complex Update copyright years. 2021-01-04 10:26:59 +01:00
endian Update copyright years. 2021-01-04 10:26:59 +01:00
exclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
gcd libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-10 16:22:54 +01:00
headers libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-10 16:22:54 +01:00
inclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
inner_product Update copyright years. 2021-01-04 10:26:59 +01:00
iota Update copyright years. 2021-01-04 10:26:59 +01:00
lcm libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-10 16:22:54 +01:00
lerp libstdc++: Add additional overload of std::lerp [PR101870] 2021-08-12 19:46:16 +01:00
midpoint libstdc++: Make some #error strings consistent with other tests 2021-08-12 19:46:16 +01:00
numbers Update copyright years. 2021-01-04 10:26:59 +01:00
partial_sum Update copyright years. 2021-01-04 10:26:59 +01:00
pstl/numeric_ops libstdc++: Remove redundant -std=gnu++17 options from PSTL tests 2021-05-10 16:22:53 +01:00
random libstdc++: Suppress redundant definitions of inline variables 2021-08-03 15:41:11 +01:00
reduce libstdc++: Replace incorrect static assertion in std::reduce [PR95833] 2021-06-18 14:46:58 +01:00
slice Update copyright years. 2021-01-04 10:26:59 +01:00
slice_array Update copyright years. 2021-01-04 10:26:59 +01:00
transform_exclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
transform_inclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
transform_reduce libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-10 16:22:54 +01:00
valarray libstdc++: Add [[nodiscard]] to iterators and related utilities 2021-08-04 12:54:28 +01:00