From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id B030C38582AD; Fri, 16 Sep 2022 22:33:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B030C38582AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663367582; bh=siqWR88JE58vpmGp/wWeSduB4xfF1jXAHTCwV+lSoo8=; h=From:To:Subject:Date:From; b=pj7jXAjsAshVECezKJEKt3a1QapfhqroinVPq5L5WFKRDf6c7jKXmd42HZIVAM3Gm VvvnwYnWNLeXmhbpONAj05HsfAXMNoJh1xsFaMnKJwt1rzwy2uKdne+h0lQ6Qy0K7X 8GcPN3XYUDTp53Yy4W0IBQ95KmiMXzIPRsxGXyoU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-2703] libstdc++: Make more internal headers include their own dependencies X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 47deb1ef874c078ac51bc1970a3324f5c8002815 X-Git-Newrev: d31e19e44009ef645f0a120043c7f84d0450b4c9 Message-Id: <20220916223302.B030C38582AD@sourceware.org> Date: Fri, 16 Sep 2022 22:33:02 +0000 (GMT) List-Id: https://gcc.gnu.org/g:d31e19e44009ef645f0a120043c7f84d0450b4c9 commit r13-2703-gd31e19e44009ef645f0a120043c7f84d0450b4c9 Author: Jonathan Wakely Date: Fri Sep 16 10:49:54 2022 +0100 libstdc++: Make more internal headers include their own dependencies This adds required headers to a few internal headers that currently assume their deps will be included first. It's more robust to make them include their own dependencies, so that later refactoring or reuse of those headers in new contexts doesn't break. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h: Include . * include/bits/stl_tempbuf.h: Include headers for __try and __catch macros, std::pair, and __gnu_cxx::__numeric_traits. * include/bits/stream_iterator.h: Include and headers for std::addressof and std::iterator. * include/bits/streambuf_iterator.h: Include header for std::iterator. * include/std/iterator: Do not include . Diff: --- libstdc++-v3/include/bits/stl_algo.h | 1 + libstdc++-v3/include/bits/stl_tempbuf.h | 4 +++- libstdc++-v3/include/bits/stream_iterator.h | 3 +++ libstdc++-v3/include/bits/streambuf_iterator.h | 1 + libstdc++-v3/include/std/iterator | 1 - 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 57fa1c1dc55..9cb708ab2fd 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -57,6 +57,7 @@ #define _STL_ALGO_H 1 #include +#include #include #include // for _Temporary_buffer #include diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h index 82f2dc8055f..b13aa3b0fcc 100644 --- a/libstdc++-v3/include/bits/stl_tempbuf.h +++ b/libstdc++-v3/include/bits/stl_tempbuf.h @@ -57,8 +57,10 @@ #define _STL_TEMPBUF_H 1 #include -#include +#include #include +#include +#include namespace std _GLIBCXX_VISIBILITY(default) { diff --git a/libstdc++-v3/include/bits/stream_iterator.h b/libstdc++-v3/include/bits/stream_iterator.h index 86c5845b835..0a1362a2eea 100644 --- a/libstdc++-v3/include/bits/stream_iterator.h +++ b/libstdc++-v3/include/bits/stream_iterator.h @@ -32,6 +32,9 @@ #pragma GCC system_header +#include +#include +#include #include namespace std _GLIBCXX_VISIBILITY(default) diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h index 72344c63088..c26ac249e01 100644 --- a/libstdc++-v3/include/bits/streambuf_iterator.h +++ b/libstdc++-v3/include/bits/streambuf_iterator.h @@ -33,6 +33,7 @@ #pragma GCC system_header #include +#include #include namespace std _GLIBCXX_VISIBILITY(default) diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator index 7f8fc50b39d..2da2fb6e4a3 100644 --- a/libstdc++-v3/include/std/iterator +++ b/libstdc++-v3/include/std/iterator @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include