From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40121 invoked by alias); 3 Sep 2015 20:40:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 40043 invoked by uid 89); 3 Sep 2015 20:40:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 03 Sep 2015 20:40:02 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9AC4FC1C90F9; Thu, 3 Sep 2015 20:40:01 +0000 (UTC) Received: from localhost (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t83Ke0lu024537; Thu, 3 Sep 2015 16:40:01 -0400 Date: Thu, 03 Sep 2015 21:12:00 -0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [patch] Clean up libstdc++ includes slightly. Message-ID: <20150903204000.GW2631@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+wSiqF7c0ySQ2tNi" Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-09/txt/msg00312.txt.bz2 --+wSiqF7c0ySQ2tNi Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-length: 205 This adjusts some missing or redundant includes, and replaces "throw bad_alloc()" (which won't work with -fno-exceptions) with a call to __throw_bad_alloc(). Tested powerpc64e-linux, committed to trunk. --+wSiqF7c0ySQ2tNi Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" Content-length: 2623 commit ca17448c303cfd58191c64abe42a750c9590aa14 Author: Jonathan Wakely Date: Thu Sep 3 21:02:41 2015 +0100 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. diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index 820edcb..f2f577b 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 f7da017..fbed043 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 790508c..fbf1740 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 ae5f199..69107cc 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) --+wSiqF7c0ySQ2tNi--