gcc/libstdc++-v3/testsuite/26_numerics
Jonathan Wakely 371e12a7fd 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.

(cherry picked from commit 9017326e19)
2021-10-12 11:45:44 +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-11 20:50:08 +01:00
gcd libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-11 20:50:08 +01:00
headers libstdc++: Remove redundant -std=gnu++17 option from remaining tests 2021-05-11 20:50:08 +01:00
inclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-11 20:50:08 +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-11 20:50:08 +01:00
lerp libstdc++: Add additional overload of std::lerp [PR101870] 2021-10-12 11:45:44 +01:00
midpoint Update copyright years. 2021-01-04 10:26:59 +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-11 20:50:07 +01:00
random libstdc++: Test std::seed_seq construction from input iterators 2021-08-24 15:18:49 +01:00
reduce libstdc++: Replace incorrect static assertion in std::reduce [PR95833] 2021-06-18 16:55:09 +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-11 20:50:08 +01:00
transform_inclusive_scan libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-11 20:50:08 +01:00
transform_reduce libstdc++: Remove redundant -std=gnu++17 option from algorithm tests 2021-05-11 20:50:08 +01:00
valarray libstdc++: Rename tests with incorrect extension 2021-10-12 11:45:43 +01:00