From c8c030589bd61290418753e766f26d8f99e8b074 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 3 Sep 2015 21:40:03 +0100 Subject: [PATCH] Clean up libstdc++ includes slightly. * include/bits/shared_ptr_base.h: Add required header. * include/std/condition_variable: Likewise. * include/std/mutex: Remove unused header. * include/std/shared_mutex: Remove redundant header. (shared_mutex::shared_mutex()): Replace throw with __throw_bad_alloc. From-SVN: r227469 --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/include/bits/shared_ptr_base.h | 4 ++-- libstdc++-v3/include/std/condition_variable | 1 + libstdc++-v3/include/std/mutex | 1 - libstdc++-v3/include/std/shared_mutex | 3 +-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b0e0af8bcb3..ced20a31a5a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,11 @@ 2015-09-03 Jonathan Wakely + * include/bits/shared_ptr_base.h: Add required header. + * include/std/condition_variable: Likewise. + * include/std/mutex: Remove unused header. + * include/std/shared_mutex: Remove redundant header. + (shared_mutex::shared_mutex()): Replace throw with __throw_bad_alloc. + PR libstdc++/66902 * src/c++11/debug.cc (_S_debug_messages): Make array const. diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index 820edcb5d4b..f2f577b9115 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -49,6 +49,7 @@ #ifndef _SHARED_PTR_BASE_H #define _SHARED_PTR_BASE_H 1 +#include #include #include @@ -67,8 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION class bad_weak_ptr : public std::exception { public: - virtual char const* - what() const noexcept; + virtual char const* what() const noexcept; virtual ~bad_weak_ptr() noexcept; }; diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable index f7da017aa63..fbed043f3c7 100644 --- a/libstdc++-v3/include/std/condition_variable +++ b/libstdc++-v3/include/std/condition_variable @@ -42,6 +42,7 @@ #include #include #include +#include #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index 790508c65c2..fbf17405b7b 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -44,7 +44,6 @@ #include #include #include // for std::swap -#include #ifdef _GLIBCXX_USE_C99_STDINT_TR1 diff --git a/libstdc++-v3/include/std/shared_mutex b/libstdc++-v3/include/std/shared_mutex index ae5f199cdde..69107cc4952 100644 --- a/libstdc++-v3/include/std/shared_mutex +++ b/libstdc++-v3/include/std/shared_mutex @@ -36,7 +36,6 @@ #else #include -#include #include #include @@ -80,7 +79,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { int __ret = pthread_rwlock_init(&_M_rwlock, NULL); if (__ret == ENOMEM) - throw bad_alloc(); + __throw_bad_alloc(); else if (__ret == EAGAIN) __throw_system_error(int(errc::resource_unavailable_try_again)); else if (__ret == EPERM) -- 2.30.2