gcc/libstdc++-v3/testsuite
Jonathan Wakely ebc464940d libstdc++: Fix std::jthread bugs
The std::jthread::get_id() function was missing a return statement.

The is_invocable check needs to be done using decayed types, as they'll
be forwarded to std::invoke as rvalues.

Also reduce header dependencies for the <thread> header. We don't need
to include <functional> for std::jthread because <bits/invoke.h> is
already included, which defines std::__invoke. We can also remove
<bits/functexcept.h> which isn't used at all. Finally, when
_GLIBCXX_HAS_GTHREADS is not defined there's no point including any
other headers, since we're not going to define anything in <thread>
anyway.

	* include/std/thread: Reduce header dependencies.
	(jthread::get_id()): Add missing return.
	(jthread::get_stop_token()): Avoid unnecessary stop_source temporary.
	(jthread::_S_create): Check is_invocable using decayed types. Add
	static assertion.
	* testsuite/30_threads/jthread/1.cc: Add dg-require-gthreads.
	* testsuite/30_threads/jthread/2.cc: Likewise.
	* testsuite/30_threads/jthread/3.cc: New test.
	* testsuite/30_threads/jthread/jthread.cc: Add missing directives for
	pthread and gthread support. Use VERIFY instead of assert.

From-SVN: r278402
2019-11-18 12:46:08 +00:00
..
17_intro Do not declare std::uses_allocator before C++11 2019-10-22 22:48:53 +01:00
18_support libsupc++: Implement comparison algorithms for C++20 2019-11-13 16:26:18 +00:00
19_diagnostics Add test for std::hash<std::error_code> 2019-05-07 16:30:29 +01:00
20_util Implement the <tuple> part of C++20 p1032 Misc constexpr bits. 2019-11-16 03:16:35 +00:00
21_strings libstdc++: add range constructor for std::string_view (P1391R4) 2019-11-17 01:32:55 +00:00
22_locale P0482R5 char8_t: Updates to existing standard library tests 2019-02-22 01:16:08 +00:00
23_containers Implement the <array> part of C++20 p1032 Misc constexpr bits. 2019-11-15 00:09:49 +00:00
24_iterators libstdc++: Rename disable_sized_sentinel [P1871R1] 2019-11-14 16:53:03 +00:00
25_algorithms libstdc++: make negative count safe with std::for_each_n 2019-11-07 23:10:45 +00:00
26_numerics Fix some missing/incorrect feature test macros 2019-10-30 16:57:13 +00:00
27_io libstdc++: Implement LWG 3070 in path::lexically_relative 2019-11-15 19:58:15 +00:00
28_regex Implement LWG 3296 for basic_regex::assign 2019-09-25 13:31:53 +01:00
29_atomics Fix inaccurate comment in new test 2019-07-12 16:45:16 +01:00
30_threads libstdc++: Fix std::jthread bugs 2019-11-18 12:46:08 +00:00
abi Update copyright years. 2019-01-01 13:31:55 +01:00
backward Adjust extension types to use allocator_traits 2019-10-23 17:14:28 +01:00
config Update copyright years. 2019-01-01 13:31:55 +01:00
data
decimal Update copyright years. 2019-01-01 13:31:55 +01:00
experimental Add iterator concepts and range access customization points for C++20 2019-10-29 17:44:18 +00:00
ext Revert ABI changes to std::allocator in C++20 2019-10-24 16:29:41 +01:00
lib PR libstdc++/90252 fix effective-target check for TBB 2019-05-21 14:50:41 +01:00
libstdc++-abi Update copyright years. 2019-01-01 13:31:55 +01:00
libstdc++-dg Implement <concepts> header for C++20 2019-10-11 16:53:52 +01:00
libstdc++-prettyprinters Improve tests for std::vector<bool> printer 2019-06-20 10:04:55 +01:00
libstdc++-xmethods Update copyright years. 2019-01-01 13:31:55 +01:00
performance Update copyright years. 2019-01-01 13:31:55 +01:00
special_functions libstdc++ testsuite, silence a FreeBSD libm warning 2019-09-30 22:23:02 +02:00
std libstdc++: Define C++20 range utilities and range factories 2019-11-17 01:07:54 +00:00
tr1 Adjust extension types to use allocator_traits 2019-10-23 17:14:28 +01:00
tr2 PR libstdc++/92059 fix several bugs in tr2::dynamic_bitset 2019-10-11 16:29:55 +01:00
util libstdc++: Implement LWG 3149 for std::default_constructible 2019-11-15 19:58:27 +00:00
Makefile.am Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00
Makefile.in Remove Profile Mode, deprecated since GCC 7.1 2019-05-13 11:50:21 +01:00