gcc/libstdc++-v3/testsuite/ext
Jonathan Wakely 5a7960da41 PR libstdc++/85749 constrain seed sequences for random number engines
Constrain constructors and member functions of random number engines so
that functions taking seed sequences can only be called with types that
meet the seed sequence requirements.

	PR libstdc++/85749
	* include/bits/random.h (__detail::__is_seed_seq): New SFINAE helper.
	(linear_congruential_engine, mersenne_twister_engine)
	(subtract_with_carry_engine, discard_block_engine)
	(independent_bits_engine, shuffle_order_engine): Use __is_seed_seq to
	constrain function templates taking seed sequences.
	* include/bits/random.tcc (linear_congruential_engine::seed(_Sseq&))
	(mersenne_twister_engine::seed(_Sseq&))
	(subtract_with_carry_engine::seed(_Sseq&)): Change return types to
	match declarations.
	* include/ext/random (simd_fast_mersenne_twister_engine): Use
	__is_seed_seq to constrain function templates taking seed sequences.
	* include/ext/random.tcc (simd_fast_mersenne_twister_engine::seed):
	Change return type to match declaration.
	* testsuite/26_numerics/random/discard_block_engine/cons/seed_seq2.cc:
	New.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	seed_seq2.cc: New.
	* testsuite/26_numerics/random/linear_congruential_engine/cons/
	seed_seq2.cc: New.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/
	seed_seq2.cc: New.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error lineno.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq2.cc:
	New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	seed_seq2.cc: New.
	* testsuite/ext/random/simd_fast_mersenne_twister_engine/cons/
	seed_seq2.cc: New.

From-SVN: r260263
2018-05-15 16:36:46 +01:00
..
array_allocator Update copyright years. 2018-01-03 11:03:58 +01:00
bitmap_allocator Update copyright years. 2018-01-03 11:03:58 +01:00
codecvt Update copyright years. 2018-01-03 11:03:58 +01:00
concurrence_lock_error Update copyright years. 2018-01-03 11:03:58 +01:00
concurrence_unlock_error Update copyright years. 2018-01-03 11:03:58 +01:00
debug_allocator Update copyright years. 2018-01-03 11:03:58 +01:00
enc_filebuf Update copyright years. 2018-01-03 11:03:58 +01:00
ext_pointer Update copyright years. 2018-01-03 11:03:58 +01:00
forced_error Update copyright years. 2018-01-03 11:03:58 +01:00
iota Update copyright years. 2018-01-03 11:03:58 +01:00
is_heap Update copyright years. 2018-01-03 11:03:58 +01:00
is_sorted Update copyright years. 2018-01-03 11:03:58 +01:00
malloc_allocator Update copyright years. 2018-01-03 11:03:58 +01:00
mt_allocator Update copyright years. 2018-01-03 11:03:58 +01:00
new_allocator Update copyright years. 2018-01-03 11:03:58 +01:00
numeric_traits Update copyright years. 2018-01-03 11:03:58 +01:00
pb_ds Update copyright years. 2018-01-03 11:03:58 +01:00
pool_allocator Update copyright years. 2018-01-03 11:03:58 +01:00
profile Update copyright years. 2018-01-03 11:03:58 +01:00
random PR libstdc++/85749 constrain seed sequences for random number engines 2018-05-15 16:36:46 +01:00
rope Update copyright years. 2018-01-03 11:03:58 +01:00
shared_ptr Update copyright years. 2018-01-03 11:03:58 +01:00
slist Update copyright years. 2018-01-03 11:03:58 +01:00
special_functions [libstdc++][testsuite] Fix dg-options/dg-add-options order 2018-01-19 11:17:34 +01:00
stdio_filebuf Update copyright years. 2018-01-03 11:03:58 +01:00
stdio_sync_filebuf Update copyright years. 2018-01-03 11:03:58 +01:00
throw_allocator Update copyright years. 2018-01-03 11:03:58 +01:00
throw_value Update copyright years. 2018-01-03 11:03:58 +01:00
type_traits Update copyright years. 2018-01-03 11:03:58 +01:00
vstring Update copyright years. 2018-01-03 11:03:58 +01:00
concept_checks.cc Update copyright years. 2018-01-03 11:03:58 +01:00
headers.cc Update copyright years. 2018-01-03 11:03:58 +01:00
median.cc Update copyright years. 2018-01-03 11:03:58 +01:00
pod_char_traits.cc Update copyright years. 2018-01-03 11:03:58 +01:00