gcc/libstdc++-v3/include
Jonathan Wakely a64775a0ed libstdc++: Make 16-bit std::subtract_with_carry_engine work [PR107466]
This implements the proposed resolution of LWG 3809, so that
std::subtract_with_carry_engine can be used with a 16-bit result_type.
Currently this produces a narrowing error when instantiating the
std::linear_congruential_engine to create the initial state. It also
truncates the default_seed constant when passing it as a result_type
argument.

Change the type of the constant to uint_least32_t and pass 0u when the
default_seed should be used.

libstdc++-v3/ChangeLog:

	PR libstdc++/107466
	* include/bits/random.h (subtract_with_carry_engine): Use 32-bit
	type for default seed. Use 0u as default argument for
	subtract_with_carry_engine(result_type) constructor and
	seed(result_type) member function.
	* include/bits/random.tcc (subtract_with_carry_engine): Use
	32-bit type for default seed and engine used for initial state.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/lwg3809.cc:
	New test.
2022-11-28 15:02:04 +00:00
..
backward libstdc++: Add preprocessor conditions for freestanding [PR106953] 2022-09-16 21:47:19 +01:00
bits libstdc++: Make 16-bit std::subtract_with_carry_engine work [PR107466] 2022-11-28 15:02:04 +00:00
c Update copyright years. 2022-01-03 10:42:10 +01:00
c_compatibility libstdc++: Add _Exit to <stdlib.h> for freestanding 2022-09-21 08:44:21 +01:00
c_global libstdc++: Small extended float support tweaks 2022-10-31 16:49:04 +01:00
c_std libstdc++: Declare std::c8rtomb and std::mbrtoc8 if provided by the C library 2022-01-18 16:31:02 +00:00
debug libstdc++: Add __gnu_debug::basic_string<>::compare overloads 2022-10-12 21:50:21 +02:00
decimal Update copyright years. 2022-01-03 10:42:10 +01:00
experimental libstdc++: Call predicate with non-const values in std::erase_if [PR107850] 2022-11-25 15:06:25 +00:00
ext libstdc++: Do not define operator!= in <random> for C++20 2022-11-25 15:01:50 +00:00
parallel Update copyright years. 2022-01-03 10:42:10 +01:00
precompiled libstdc++: Implement C++20 <format> [PR104166] 2022-11-13 01:10:44 +00:00
pstl libstdc++: Declare const global variables inline 2022-11-06 11:30:47 -05:00
std libstdc++: Call predicate with non-const values in std::erase_if [PR107850] 2022-11-25 15:06:25 +00:00
tr1 libstdc++: Mark headers that must be hosted as such [PR103626] 2022-10-03 15:43:48 +01:00
tr2 Update copyright years. 2022-01-03 10:42:10 +01:00
Makefile.am libstdc++: add experimental Contracts support 2022-11-18 21:40:29 -05:00
Makefile.in libstdc++: add experimental Contracts support 2022-11-18 21:40:29 -05:00