r263370 - in /branches/gcc-8-branch/libstdc++-v...

redi@gcc.gnu.org redi@gcc.gnu.org
Tue Aug 7 21:39:00 GMT 2018


Author: redi
Date: Tue Aug  7 21:38:59 2018
New Revision: 263370

URL: https://gcc.gnu.org/viewcvs?rev=263370&root=gcc&view=rev
Log:
PR libstdc++/84535 constrain std::thread constructor

The standard requires that the std::thread constructor is constrained so
it can't be called with a first argument of type std::thread. The
current implementation only meets that requirement if the constructor is
called with one argument, by using deleted overloads. This uses an
enable_if constraint to enforce the requirement for any number of
arguments.

Also add a static assertion to give a more readable error for invalid
arguments that cannot be invoked.

Backport from mainline
2018-05-03  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/84535
	* include/std/thread (thread::__not_same): New SFINAE helper.
	(thread::thread(_Callable&&, _Args&&...)): Add SFINAE constraint that
	first argument is not a std::thread. Add static assertion to check
	INVOKE expression is valid.
	(thread::thread(thread&), thread::thread(const thread&&)): Remove.
	* testsuite/30_threads/thread/cons/84535.cc: New.

Added:
    branches/gcc-8-branch/libstdc++-v3/testsuite/30_threads/thread/cons/84535.cc
Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/include/std/thread



More information about the Libstdc++-cvs mailing list