]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Restore std::scoped_lock for non-gthreads targets [PR120198]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 9 May 2025 16:50:52 +0000 (17:50 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 12 May 2025 11:26:53 +0000 (12:26 +0100)
commitbdd2753f5f021a15a6c4ef02565356985fea1300
tree907e63cbb014d28ae4f3281346ee50094cfb2d99
parent67c8e777d466d3bed9830bf01841c96b6881b58d
libstdc++: Restore std::scoped_lock for non-gthreads targets [PR120198]

This was a regression introduced with using version.def to define
feature test macros (r14-3248-g083b7f2833d71d). std::scoped_lock doesn't
need to depend on gthreads and so can be defined unconditionally, even
for freestanding.

libstdc++-v3/ChangeLog:

PR libstdc++/120198
* include/bits/version.def (scoped_lock): Do not depend on
gthreads or hosted.
* include/bits/version.h: Regenerate.
* include/std/mutex (scoped_lock): Update comment.
* testsuite/30_threads/scoped_lock/requirements/typedefs.cc:
Remove dg-require-gthreads and use custom lockable type instead
of std::mutex. Check that typedef is only present for a single
template argument.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/include/std/mutex
libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc