gcc/libstdc++-v3/testsuite/26_numerics
Jonathan Wakely 4894d69a1f libstdc++: Add missing constraints to std::bit_cast [PR105027]
Our std::bit_cast was relying on the compiler to check for errors inside
__builtin_bit_cast, instead of checking them as constraints. That means
std::bit_cast was not SFINAE-friendly.

This fix uses a requires-clause, so for old versions of Clang without
concepts support the function will still be unconstrained. At some point
in future we can remove the #ifdef __cpp_concepts check and rely on all
compilers having full concepts support in C++20 mode.

libstdc++-v3/ChangeLog:

	PR libstdc++/105027
	* include/std/bit (bit_cast): Add constraints.
	* testsuite/26_numerics/bit/bit.cast/105027.cc: New test.
2022-03-23 12:17:16 +00:00
..
accumulate
adjacent_difference
bit
complex
endian
exclusive_scan
gcd
headers
inclusive_scan
inner_product
iota
lcm
lerp
midpoint
numbers
partial_sum
pstl/numeric_ops
random
reduce
slice
slice_array
transform_exclusive_scan
transform_inclusive_scan
transform_reduce
valarray