From patchwork Fri Oct 7 11:57:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1810 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp257494wrs; Fri, 7 Oct 2022 04:58:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4qzsvQUOJbCbR/WT63VEZyXQcsUa9mCc/TQMpZwFkdkMUIOP5ZdYfkSV0zLqq+evlJuDnw X-Received: by 2002:a17:907:1ded:b0:78d:4606:268 with SMTP id og45-20020a1709071ded00b0078d46060268mr3756750ejc.163.1665143904153; Fri, 07 Oct 2022 04:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665143904; cv=none; d=google.com; s=arc-20160816; b=YUBPLgtGNkStjd2yNK41hVAVquZQr8RM2y9NzJLP7DqJ07tVZDYw46PyMPRtAKCHvx 5q/jkCxsyyPkSPD6aJQojF57C4+OP4Jrl488uWsPf2oKUAGqSWxcGY+rgUKGpseHlPz8 l+gGu17NhjbR2WuxIgekY/gsojc2aqVv0lwsQe5TU+3F0Cod86NcAE5L8yqUC760LQ1x 7/UUU6DN+eSJMW4KmqGIMfypyJwSgVRGrzJ9A8K3xpwfTqyDtnqsQ4csuH23CORg6YsS gxK2XqUrlX8+QG697ACIaO+CDATMRSFYzY3N3nZ9tFHe1fMwOSGuPqRFqc6eSgb86ZW4 +TVQ== 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=c30qqT4gCqSaqCWIXlzbD9NlqtsYgpZnqqtPrwyPZnk=; b=LemLJp1juEd8RQ9dOUL9P0h7qOdxxnQMobhUTW9RGXGnFIwIIFPQaFGQkI5CBEE1wM oWcAU6xm2w9vCHXf8d6xP2aKaHTzaZrtLURXlS/iPZDkuhOD/WrsvniqCH+4yJdjXE1D O3DRJjrjJBjlMrTKb7/Z+4drE1j5LA4OUFBj1pk2Yl+MC4njj5d8+69zyaPa+D7YiaxH iFZcD4LNlv/1nGuLp0+Z5jaUl4FhSzXZh4bkPH9XksMroeY+2+CvEorETUi6DmefaPcJ 4U9yLuvBFXabFon1uNh/5wwjOTxtmlzoLctbNa+V+60xMq6gZg9Wa6R7X34cKrTa/Rej gnAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="rBnM3DT/"; 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 nc4-20020a1709071c0400b007877f3132d9si2235034ejc.438.2022.10.07.04.58.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 04:58:24 -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="rBnM3DT/"; 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 D75B4385DC31 for ; Fri, 7 Oct 2022 11:58:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D75B4385DC31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665143902; bh=c30qqT4gCqSaqCWIXlzbD9NlqtsYgpZnqqtPrwyPZnk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=rBnM3DT/sKo5/nH2YBFHQUHK2OJhECAT8vSXBjsH2RWcAiApzIT6woYJBiqKRwjSD p5NjMyDJKcL78z6LWRYF2wYxeZ7SCyM2ESI/LLSfRmGiy8SSiy8OkxaTKQGRnBpZxn 0uCB/H44xeorRyQtKDrNqeiQKFytJk5Y3C77IqvA= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 73E7E3858C62 for ; Fri, 7 Oct 2022 11:57:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 73E7E3858C62 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-16-A-aBWZrRNmqNYDBH3xPg9A-1; Fri, 07 Oct 2022 07:57:02 -0400 X-MC-Unique: A-aBWZrRNmqNYDBH3xPg9A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3DCC185A7A8; Fri, 7 Oct 2022 11:57:01 +0000 (UTC) Received: from localhost (unknown [10.33.36.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B1A72166B35; Fri, 7 Oct 2022 11:57:01 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Shuffle header dependencies of Date: Fri, 7 Oct 2022 12:57:01 +0100 Message-Id: <20221007115701.1226696-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 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_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable 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?1746029934300242420?= X-GMAIL-MSGID: =?utf-8?q?1746029934300242420?= Tested x86_64-linux, Pushed to trunk. -- >8 -- The header is needed by std::function to use placement new, so include it in instead of in . libstdc++-v3/ChangeLog: * include/bits/std_function.h: Include but do not include . * include/std/functional: Do not include . --- libstdc++-v3/include/bits/std_function.h | 10 +++++----- libstdc++-v3/include/std/functional | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/libstdc++-v3/include/bits/std_function.h b/libstdc++-v3/include/bits/std_function.h index f5423a3a5c7..8ab32a6855e 100644 --- a/libstdc++-v3/include/bits/std_function.h +++ b/libstdc++-v3/include/bits/std_function.h @@ -36,11 +36,11 @@ # include #else -#include -#include -#include -#include -#include +#include // placement new +#include // typeid +#include // __invoke_r +#include // ref wrapper, _Maybe_unary_or_binary_function +#include // __throw_bad_function_call namespace std _GLIBCXX_VISIBILITY(default) { diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index adf9cb1c546..d22acaa3cb8 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -46,11 +46,10 @@ #pragma GCC system_header #include -#include +#include // std::equal_to, std::unary_function etc. #if __cplusplus >= 201103L -#include #include #include #include @@ -67,8 +66,8 @@ # endif # include // std::search #endif -#if __cplusplus > 201703L -# include +#if __cplusplus >= 202002L +# include // std::identity, ranges::equal_to etc. # include #endif #if __cplusplus > 202002L && _GLIBCXX_HOSTED