From patchwork Fri Sep 16 22:33:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1270 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp955330wrt; Fri, 16 Sep 2022 15:35:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Tz/3o3zMv+oNCVCxBTNJ03JMMDLUusSxp2anHh8PzcHBB7hxUgNKSPyseCnoDk79q0LgR X-Received: by 2002:a05:6402:184f:b0:44e:7c1d:9b10 with SMTP id v15-20020a056402184f00b0044e7c1d9b10mr5681258edy.97.1663367728488; Fri, 16 Sep 2022 15:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663367728; cv=none; d=google.com; s=arc-20160816; b=cPbX8sWlcko0qUDl3/BpPTQjZKsjNx23EV2iiyx0s/Q+EtBrwyT/nYLEcXogUmh1dG w2barkHgCH+puKqf6KY2LAaWQOrz9pOt7U5NgIFF9wM3YsSUAV3UiE4mnP+pYWEDdhwU iC3MdxsVBKckn6qUHs//DQhDbyVZDWQXkivN1PbhaM2TiSQmwMAwfoqweomd23gyvvAB fDlLDJNG7bF9TrrvOgyLPZhguDZaKE6pwYtuyL+KLUy8YbJFGxGU1CEyCfzdkeSGK4fq yF+qewsjpmC6kM+QyOkrdovgiQX+js0v9Ycir/2+Ng0veweO1BKhTLii7dYFYIzgmUkh 0gDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=q/XJnrMHYD7srMqspkHym0/q9hgrU8KhDvG6s7HFCrM=; b=RB+wrPX6hrk+3vx3Xn4uvPs97tA15ddJn6BA/1Ghjr1WcJrAJ9e0+qiu9ZbpFEeKk8 pxaH1AWDaeOAm9egnRVLL3hxkMn3zEKmdn60Ih6ij9oqAbETCcdd7UOcrjGb67J/TO1w st2V20LuTe88VJVlgJZAax1Qz23Spz0uw0rhfYliaJHUHgC7FQMtQBzhY5TA1eJ2k+EO Rl7XzJoLQaFnc2Cz4z47zXaedil/5pCE3ptzvC7pL5m3KhewJsEZi+Pb/PGG3td2K+2b TghRc7qP8b2a01a9nThc25/XRP7jABmSJFq4Jdlehr1NVAFpQuApEiHqkpaU0OtxNWbp hLJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uCftJyUu; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gt31-20020a1709072d9f00b0072b40bc7412si592136ejc.223.2022.09.16.15.35.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 15:35:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uCftJyUu; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7CA34382EA27 for ; Fri, 16 Sep 2022 22:34:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7CA34382EA27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663367696; bh=q/XJnrMHYD7srMqspkHym0/q9hgrU8KhDvG6s7HFCrM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=uCftJyUuiZWmin4loDsrIDBaFKkCQJQhuFzz1//G2kGITaMlmsl3An4YHqk342Fwz PJSOboWvDI9HaBZ1MlVKhL9mTqHgbha42pKP8/LnoRK2j+h0pOe2MARqaIHZtBBMre 3wE4EjSYUxsFounpa7pOoEAkQFy7lyXaNDZV2Hfs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 15BAE384D15E for ; Fri, 16 Sep 2022 22:33:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15BAE384D15E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-w7F-KKG4MQqmwhR-aT-Okw-1; Fri, 16 Sep 2022 18:33:35 -0400 X-MC-Unique: w7F-KKG4MQqmwhR-aT-Okw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2D7448001B8; Fri, 16 Sep 2022 22:33:35 +0000 (UTC) Received: from localhost (unknown [10.33.36.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id E99C740C2064; Fri, 16 Sep 2022 22:33:34 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Make more internal headers include their own dependencies Date: Fri, 16 Sep 2022 23:33:34 +0100 Message-Id: <20220916223334.602262-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1744167479238123911?= X-GMAIL-MSGID: =?utf-8?q?1744167479238123911?= Tested x86_64-linux, pushed to trunk. -- >8 -- 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 . --- 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