diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-09-14 14:03:19 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-09-14 19:17:36 +0100 |
commit | 0bc9aa9c3fcb1f3534575314038661ff111874dd (patch) | |
tree | e3262c029e392a5547e1904c68090c1d868e9066 /gcc | |
parent | 8b1bc3051bd68ce193a8612fa3b1a65c0353b5b0 (diff) | |
download | gcc-0bc9aa9c3fcb1f3534575314038661ff111874dd.zip gcc-0bc9aa9c3fcb1f3534575314038661ff111874dd.tar.gz gcc-0bc9aa9c3fcb1f3534575314038661ff111874dd.tar.bz2 |
libstdc++: Add assertion to std::promise::set_exception (LWG 2276)
Without this assertion, the shared state is made ready, but contains
neither a value nor an exception. Add an assertion to prevent users from
accessing a value that was never initialized in the shared state.
libstdc++-v3/ChangeLog:
* include/std/future
(_State_baseV2::__setter(exception_ptr&, promise&)): Add
assertion for LWG 2276 precondition.
* testsuite/30_threads/promise/members/set_exception_neg.cc:
New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions