From patchwork Mon Sep 5 16:45:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1000 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp259079wrt; Mon, 5 Sep 2022 09:46:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hd/EAxj2ib2IBAvk0kyqqdsdHspfSQfppHtv2wZkllpqklfaBDM+CCuUKQs07BSkISMtg X-Received: by 2002:a17:907:d0f:b0:731:5c2:a9a5 with SMTP id gn15-20020a1709070d0f00b0073105c2a9a5mr34835984ejc.413.1662396378668; Mon, 05 Sep 2022 09:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662396378; cv=none; d=google.com; s=arc-20160816; b=liC5etrrqfBWoX5EHAhVZ1JKRFOYc7L5DcC0YAKvPV0CXN08bxldyh9MGNUzGayEVm CIzcHs9PsNAt/tAhI25wvUYaurPtvLjYLNS+LD/pNRRNHw3fx2KVU/lg2SZrlTRWx5pK ErBnGp9mla2i43QPllVg8Lxt5musxhQd79Nwpadyo7Gy3DWxMXaHvzFi4hIbEcd1vXaj FLXBr+9g8pTBWVSEVN7D7tiaHPYlBR5qU6xZ1Es1PJDZCHISJQjO9NRbH1Wb70sTTbyx asV9pxXN3iKxVZ/u0lc5lTHYS3u6LTMWVtmVC5J2DQDqWu4sC4idQfmzQo2WEw8p6aZo Azsw== 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=+iMG9eb0FfKiocpVH3Yl6+sZfLEXugr/nDhQsJHvHjE=; b=HrdVQ2nL6pd0kCS9vaVa+tVQx8ojWemm0zzU0Hv0dfbrTfQ3FdAA917Tjku8wRwnx7 NciNnZ5eZB6tdlLimV5cCwa8LqAu1J3WhyiRuzCcaPVMF5wDT/bL2qcefa65GnjMMNTN x0ORAFylC54bMJQlkfGBWGiGPQqSRxL4aDD//sjnHrw0DUkdJrFWDiGCB7Y2Mk5yCymh 2N4wrE5qStBGd3X0bDgEKAapYSavmrmRCCSxxqUammNlaqFEQ4xnwhlIvQuCLv9T9QPO 2PsSYxtwtflsSabJfZxf8W2v12tJcTiEUv7z0fjNxDus2ififKWd5tioJJ5wZcWh0DXK v+Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=aXx3XSPs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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. [8.43.85.97]) by mx.google.com with ESMTPS id b13-20020a056402350d00b00447f00ddb10si8205045edd.340.2022.09.05.09.46.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 09:46:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=aXx3XSPs; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 512A63851C07 for ; Mon, 5 Sep 2022 16:45:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 512A63851C07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662396354; bh=+iMG9eb0FfKiocpVH3Yl6+sZfLEXugr/nDhQsJHvHjE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=aXx3XSPsh+yjeMm2hrQDW+SsoDsuaun5ZMv4QiFnW035RxJzMHp2vO9z1r0QIWVbu 1Wmi9tNM/bLSiojTxvH0/2N7VCqP13PMaLc8E+4NNbp//wdsMyvgMgPwoh5dojasUH iY63aEuPTUG+nCtOcb0B3A7u0yY0izOdtanqDPPg= 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 AC90D3856963 for ; Mon, 5 Sep 2022 16:45:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC90D3856963 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-Dqi0GCKQMjKzf7ia1jjSrw-1; Mon, 05 Sep 2022 12:45:05 -0400 X-MC-Unique: Dqi0GCKQMjKzf7ia1jjSrw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E62BD3804506; Mon, 5 Sep 2022 16:45:04 +0000 (UTC) Received: from localhost (unknown [10.33.36.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB8A61415102; Mon, 5 Sep 2022 16:45:04 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Move __success_type and __failure_type later in file Date: Mon, 5 Sep 2022 17:45:04 +0100 Message-Id: <20220905164504.670854-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 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, T_SCC_BODY_TEXT_LINE 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?1743148945145466096?= X-GMAIL-MSGID: =?utf-8?q?1743148945145466096?= Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/type_traits (__success_type, __failure_type): Move definitions later in the file. --- libstdc++-v3/include/std/type_traits | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index e19d964fa9c..e4d167939d9 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -286,18 +286,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION >::type __is_complete_or_unbounded(_TypeIdentity) { return {}; } - // For several sfinae-friendly trait implementations we transport both the - // result information (as the member type) and the failure information (no - // member type). This is very similar to std::enable_if, but we cannot use - // them, because we need to derive from them as an implementation detail. - - template - struct __success_type - { typedef _Tp type; }; - - struct __failure_type - { }; - // __remove_cv_t (std::remove_cv_t for C++11). template using __remove_cv_t = typename remove_cv<_Tp>::type; @@ -2162,6 +2150,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Sfinae-friendly common_type implementation: /// @cond undocumented + + // For several sfinae-friendly trait implementations we transport both the + // result information (as the member type) and the failure information (no + // member type). This is very similar to std::enable_if, but we cannot use + // that, because we need to derive from them as an implementation detail. + + template + struct __success_type + { typedef _Tp type; }; + + struct __failure_type + { }; + struct __do_common_type_impl { template