libstdc++: Add static assertions to futures and promises [LWG 3458]
LWG recently decided it should be ill-formed to instantiate std::future
and std::shared_future for types that can't be returned from a function.
This adds static assertions to enforce it (std::future already failed,
but this makes the error more understandable).
LWG 3466 extends that to std::promise. The actual constraint is that
t.~T() is well-formed for the primary template, but rejecting arrays and
functions as done for futures matches that condition.
libstdc++-v3/ChangeLog:
* include/std/future (future, shared_future, promise): Add
static assertions to the primary template to reject array and
function types.
* testsuite/30_threads/future/requirements/lwg3458.cc: New test.
* testsuite/30_threads/promise/requirements/lwg3466.cc: New test.
* testsuite/30_threads/shared_future/requirements/lwg3458.cc: New test.