]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Do not include <exception> in <mutex>
authorJonathan Wakely <jwakely@redhat.com>
Wed, 31 May 2023 10:34:19 +0000 (11:34 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 31 May 2023 12:17:46 +0000 (13:17 +0100)
commit5a07b3b8bb9ce20849d6269e1601ead0ad3b8f75
tree140ecfa8d7e764b78d1f790a4f29932f4afe6063
parent0ed5259ccbd66d190365ab33b05ad5879263a623
libstdc++: Do not include <exception> in <mutex>

We previously needed <exception> in <mutex> for the std::lock_error
exception class, but that was moved out of <mutex> in 2009 when it was
removed from the C++0x draft. We can stop including <exception> now.

Move the include for <bits/error_constants.h> to <bits/unique_lock.h>
where it's actually used, and only include <errno.h> in <mutex> (for
EAGAIN and EDEADLK).

Also add some headers to <mutex> that are needed but are not included
directly: <bits/functexcept.h>, <bits/invoke.h> and <bits/move.h>.

libstdc++-v3/ChangeLog:

* include/bits/unique_lock.h: Include <bits/error_constants.h>
here for std::errc constants.
* include/std/mutex: Do not include <bits/error_constants.h> and
<exception> here.
libstdc++-v3/include/bits/unique_lock.h
libstdc++-v3/include/std/mutex