From patchwork Sat Jul 8 05:29:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Matsui X-Patchwork-Id: 117388 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3717727vqx; Fri, 7 Jul 2023 22:31:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlHMzAQF6net1z4KG65VNyrMAmI14TxVoMUIqgQujthxtU9x3EstfbmPfBDtw/C/+WaIx2dg X-Received: by 2002:a50:ec99:0:b0:51d:f74c:1d44 with SMTP id e25-20020a50ec99000000b0051df74c1d44mr5595034edr.31.1688794294499; Fri, 07 Jul 2023 22:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688794294; cv=none; d=google.com; s=arc-20160816; b=cE9eWnfZj8ZsfLDbMG/ntxxg0ceTsW7F9FIKfyHMnGnqWhoNowib6KaCQt7J/1apY/ qnPoxk65+azvA+Yk1lcx/DeMxkVvNozFm6JhDFNwye6TO4D+KHrJhSDCybKRlGM292Tu 0g4jBztjlazpaWxXpfnC6DdicHHdaLHgltYOZtQ9YGaueEaZP4GVYvIA31Msuslw2IL9 gkyClStwlhAyI58jpRV50IEV8xvDVuDFul5VOc/Cg4xUXfpzGY/+KJOiCEq9TwfX/n9F f5uHUUe9jUX3+wVx+Nmbv8k306H8FHyC00iARKKkmK3E7lM2LhZKjGbeicxo+EultmTH Sgrg== 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:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=5z03JDeLvAsBPWVRl1cXWjltr5/A0pUTUW0+W2nb6pU=; fh=1CAabwJrK+ugngH18pg8mqZVlwzSJe6ffxxXK5OO7Vs=; b=fKV7LWiur2BcYoGpb/E6D8zFnjA/F1TXAS5KLlDTb9YpPQjwLjsJKRsaNC5arhAbqp p1UDGPsM73OoaX2n36erxjdUqVrlkhLHjtDgYLeaLkUp2C4/MwuHnpQTbDvUonCLa5wc jmsSSTMRq6iji9AewLqw3G18LtYhAs6IUS4pQHoUHi2C3FTYeZFxw0bx/N93xglC2Is1 V/XHniwB83O1vbl4fZNrmEHIy81/VWx15Wx09ktcFpK1ryS3AyCDEk0BvaNTy51oogGH kTRSal2CF2OQuILwcEsGbpA70saGMlspyDSLUc0PXL77tUOSEZtZrb4it33FC396Z3pE Mi7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JD2Dr+sA; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q18-20020a056402033200b0051de2c487b1si3007160edw.477.2023.07.07.22.31.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 22:31:34 -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=JD2Dr+sA; 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 024273853D2C for ; Sat, 8 Jul 2023 05:31:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 024273853D2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688794270; bh=5z03JDeLvAsBPWVRl1cXWjltr5/A0pUTUW0+W2nb6pU=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=JD2Dr+sAEoVCxfYsMSN/2CsdrdOGwPE/rQnjOkyPoNSvsNngjXCAl7CHfcYrh1CSy obvYhclwoDCtLhibWUZJMjc/9/5pRqEzyYX2sR9ZgXdgKWjtlkFkRkNt6zar4yBqq8 My4q2/7aHdxG+FdT4FOOWsAw7zkihLoTeNgqaLm8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-00641c01.pphosted.com (mx0a-00641c01.pphosted.com [205.220.165.146]) by sourceware.org (Postfix) with ESMTPS id 461C0385AFB6; Sat, 8 Jul 2023 05:30:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 461C0385AFB6 Received: from pps.filterd (m0247472.ppops.net [127.0.0.1]) by mx0a-00641c01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36859kXQ015807; Sat, 8 Jul 2023 05:30:26 GMT Received: from mxout26.s.uw.edu (mxout26.s.uw.edu [140.142.234.176]) by mx0a-00641c01.pphosted.com (PPS) with ESMTPS id 3rpxxyrer5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 08 Jul 2023 05:30:26 +0000 Received: from smtp.washington.edu (smtp.washington.edu [140.142.234.157]) by mxout26.s.uw.edu (8.14.4+UW20.07/8.14.4+UW22.04) with ESMTP id 3685U78c014283 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Jul 2023 22:30:07 -0700 X-Auth-Received: from localhost.localdomain ([10.154.74.234]) (authenticated authid=kmatsui) by smtp.washington.edu (8.16.1+UW21.10/8.14.4+UW19.10) with ESMTPSA id 3685TTQA032199 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 7 Jul 2023 22:30:07 -0700 X-UW-Orig-Sender: kmatsui@smtp.washington.edu To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Ken Matsui Subject: [PATCH v2 2/2] libstdc++: use new built-in trait __remove_pointer Date: Fri, 7 Jul 2023 22:29:28 -0700 Message-ID: <20230708052928.67485-2-kmatsui@gcc.gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230708052928.67485-1-kmatsui@gcc.gnu.org> References: <20230624101210.57519-1-kmatsui@cs.washington.edu> <20230708052928.67485-1-kmatsui@gcc.gnu.org> MIME-Version: 1.0 X-Proofpoint-GUID: RrVUYt5_EC6bWA8GpMDzAwP8kM4FHRwp X-Proofpoint-ORIG-GUID: RrVUYt5_EC6bWA8GpMDzAwP8kM4FHRwp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-08_02,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1034 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 mlxlogscore=822 priorityscore=1501 spamscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307080048 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NEUTRAL, 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: Ken Matsui via Gcc-patches From: Ken Matsui Reply-To: Ken Matsui 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?1769578620322032215?= X-GMAIL-MSGID: =?utf-8?q?1770829166043608250?= This patch lets libstdc++ use new built-in trait __remove_pointer. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_pointer): Use __remove_pointer built-in trait. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_traits | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 0e7a9c9c7f3..81497e2f3e1 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2023,6 +2023,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Pointer modifications. + /// remove_pointer +#if __has_builtin(__remove_pointer) + template + struct remove_pointer + { using type = __remove_pointer(_Tp); }; +#else template struct __remove_pointer_helper { using type = _Tp; }; @@ -2031,11 +2037,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __remove_pointer_helper<_Tp, _Up*> { using type = _Up; }; - /// remove_pointer template struct remove_pointer : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> { }; +#endif template struct __add_pointer_helper