diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-07-22 20:10:38 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-07-22 20:11:00 +0100 |
commit | 1f53367fb5f16985e82c39f56368b956292cf86c (patch) | |
tree | 557ab60dd23a3f0fa24b28f4f1d6ac0277ef50ed /gcc/c | |
parent | e55ba804d3b8de86a430a8a5553dfc1ad06daa74 (diff) | |
download | gcc-1f53367fb5f16985e82c39f56368b956292cf86c.zip gcc-1f53367fb5f16985e82c39f56368b956292cf86c.tar.gz gcc-1f53367fb5f16985e82c39f56368b956292cf86c.tar.bz2 |
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.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions