From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id DE3973870891; Wed, 2 Sep 2020 13:13:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE3973870891 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599052420; bh=GBSLxMAMHW3F534oU/qY/jiCT3Ik8WXFTdKkbsOBzAo=; h=From:To:Subject:Date:From; b=jWKKSZwhkWMVk1Qli0Zsmml5m/Dxj1yH+P3ZkBHpQ5s8Kxxl93sTj5Xbk3L5rbqO4 dBO7ShT6Qb9LMmoFAGI3/yKhyxq5O2w6bRRuTbTeLiHs72FMOXR0yqxpGBxDc3jIQl K0lX4kurvwcEK6VXxE63D2zGXIfIqrtA5ZwRcaIw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-2979] libstdc++: Break header cycle between and X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: b567d3bd302933adb253aba9069fd8120c485441 X-Git-Newrev: 6bdbf0f37bda2587a4e82cbb956de7a159a397ae Message-Id: <20200902131340.DE3973870891@sourceware.org> Date: Wed, 2 Sep 2020 13:13:40 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2020 13:13:41 -0000 https://gcc.gnu.org/g:6bdbf0f37bda2587a4e82cbb956de7a159a397ae commit r11-2979-g6bdbf0f37bda2587a4e82cbb956de7a159a397ae Author: Jonathan Wakely Date: Wed Sep 2 13:27:57 2020 +0100 libstdc++: Break header cycle between and The and headers each include each other, which makes building them as header-units "exciting". The header only needs the definition of std::exception (in order to derive from it) which is already in its own header, so just include that. libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h: Include for definitions of __try, __catch and __throw_exception_again. (counted_iterator::operator++(int)): Use __throw_exception_again instead of throw. * libsupc++/new: Include not . * libsupc++/new_opvnt.cc: Include . * testsuite/18_support/destroying_delete.cc: Include for std::is_same_v definition. * testsuite/20_util/variant/index_type.cc: Qualify size_t. Diff: --- libstdc++-v3/include/bits/stl_iterator.h | 3 ++- libstdc++-v3/libsupc++/new | 4 ++-- libstdc++-v3/libsupc++/new_opvnt.cc | 3 ++- libstdc++-v3/testsuite/18_support/destroying_delete.cc | 1 + libstdc++-v3/testsuite/20_util/variant/index_type.cc | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index f0cf4c55c09..da740e3732e 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -79,6 +79,7 @@ #if __cplusplus > 201703L # include # include +# include # include #endif @@ -2062,7 +2063,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return _M_current++; } __catch(...) { ++_M_length; - throw; + __throw_exception_again; } } diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new index ebd1c490282..21848a573d1 100644 --- a/libstdc++-v3/libsupc++/new +++ b/libstdc++-v3/libsupc++/new @@ -38,7 +38,7 @@ #pragma GCC system_header #include -#include +#include #pragma GCC visibility push(default) @@ -52,7 +52,7 @@ namespace std * * @c bad_alloc (or classes derived from it) is used to report allocation * errors from the throwing forms of @c new. */ - class bad_alloc : public exception + class bad_alloc : public exception { public: bad_alloc() throw() { } diff --git a/libstdc++-v3/libsupc++/new_opvnt.cc b/libstdc++-v3/libsupc++/new_opvnt.cc index 9f9dace5778..771696d4ba6 100644 --- a/libstdc++-v3/libsupc++/new_opvnt.cc +++ b/libstdc++-v3/libsupc++/new_opvnt.cc @@ -25,7 +25,8 @@ #include #include "new" - +#include "exception_defines.h" + _GLIBCXX_WEAK_DEFINITION void* operator new[] (std::size_t sz, const std::nothrow_t&) noexcept { diff --git a/libstdc++-v3/testsuite/18_support/destroying_delete.cc b/libstdc++-v3/testsuite/18_support/destroying_delete.cc index 96134d7e010..f0c9bb9fa25 100644 --- a/libstdc++-v3/testsuite/18_support/destroying_delete.cc +++ b/libstdc++-v3/testsuite/18_support/destroying_delete.cc @@ -19,6 +19,7 @@ // { dg-do run { target c++2a } } #include +#include #include #ifndef __cpp_lib_destroying_delete diff --git a/libstdc++-v3/testsuite/20_util/variant/index_type.cc b/libstdc++-v3/testsuite/20_util/variant/index_type.cc index 73863fa677f..1c44758363c 100644 --- a/libstdc++-v3/testsuite/20_util/variant/index_type.cc +++ b/libstdc++-v3/testsuite/20_util/variant/index_type.cc @@ -22,4 +22,4 @@ #include static_assert(sizeof(std::variant) - < sizeof(size_t)); + < sizeof(std::size_t));