From patchwork Mon Jul 10 05:23:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Matsui X-Patchwork-Id: 117604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4795402vqx; Sun, 9 Jul 2023 22:29:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlG1OzFKRc4bIr533beyNnXM1ZEQfxqjmJRs3J6UiOT5dEkj4J5jXbLFePKDsuU2QhBKdpbO X-Received: by 2002:a19:7710:0:b0:4fb:8a92:4fd5 with SMTP id s16-20020a197710000000b004fb8a924fd5mr8184598lfc.54.1688966991622; Sun, 09 Jul 2023 22:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688966991; cv=none; d=google.com; s=arc-20160816; b=Te9jTrmwLtMiUjso+soH7nDF/sFLqW2B9OGROjNSN72kK5xZiC8hrdxUhJ6qu8Ln93 APTG4ZZ8gID2zlrmsH2vHWQ5lmdFBrry5Quj4ue8qGg9bKPwQGx3wRnsNb4bFFchhkQc Dgn74xo51iirs9k4gOkGKZ5nVCRJEzNlIRJpMGqPnKUQ55fWP4LbqO0pyPMWnDEwRivk kN1d3bzSmocbmYd0PF6gCVA6NvU1UEzyLV/lpMXtZ7htjvOy7EEQ516R2RxM1GRhWgrj GYsgpZiEOlWPoEO5HvU7FyYQVpwiTTJtXOcyfz12D2RjjUigrGqjmjkL07uNz29WGEM8 Hz/w== 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=+x8MCd7xNeP71UXrri3KPgZy3ykmq6KJcbkqHY7uqOc=; fh=1CAabwJrK+ugngH18pg8mqZVlwzSJe6ffxxXK5OO7Vs=; b=RgQW/Rq51nR9KXTN7iXUXDzILekCa6y9mcM1Htukicd9GIzQHYYzckDNd22obmRT4q lK9K/wX4BccHnr3+tCYVqUIO93Ho4JqJ4MLHMVDubRYelK1WF1IitS56E0OTW/cCBcFb 8+2XW9F7BrZgReobmzd+rzI72JjE9M8BziV5aE+AuxIjt8LgaJL8BMcmwj9OGIn523VK GjWo6AVAGjlvhuKYo68QMlKT0K9JkCYDhcE6GcF1V31aWmMw/KJ3fwFazMYU/1LE6jkU ZJY+wTceF8bCnJpFJGmzQIGZNIk6EokUJ3FOWjfV8kvgx/KUs3ZlVrEv1gIiMKEMQirM WUig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vlaRLHMt; 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 c6-20020aa7c746000000b0051e0315eca0si7639426eds.58.2023.07.09.22.29.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 22:29:51 -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=vlaRLHMt; 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 30D763854EB5 for ; Mon, 10 Jul 2023 05:25:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30D763854EB5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688966720; bh=+x8MCd7xNeP71UXrri3KPgZy3ykmq6KJcbkqHY7uqOc=; 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=vlaRLHMt197osmZvDbDYa6GSQFW2EIWl2CBgmvhtSY4/cVDWLqlkA10ZxGWVeFb2W 1TR8U4d6SY68bgOOeoOdkrOw7if+rPZn1kss7wpeoWay3sSxgx7/YZT17MzksuPPcn 7Ljn+9ip012CH/YNFlrDFt39coMxSd0So5NpaLa8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-00641c01.pphosted.com (mx0b-00641c01.pphosted.com [205.220.177.146]) by sourceware.org (Postfix) with ESMTPS id 786F63858C3A; Mon, 10 Jul 2023 05:24:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 786F63858C3A Received: from pps.filterd (m0247479.ppops.net [127.0.0.1]) by mx0a-00641c01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36A5HsRu032013; Mon, 10 Jul 2023 05:24:02 GMT Received: from mxout26.s.uw.edu (mxout26.s.uw.edu [140.142.234.176]) by mx0a-00641c01.pphosted.com (PPS) with ESMTPS id 3rqhdmvpb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 05:24:02 +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 36A5Nu87009961 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 9 Jul 2023 22:23:56 -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 36A5NBK6025924 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sun, 9 Jul 2023 22:23:56 -0700 X-UW-Orig-Sender: kmatsui@smtp.washington.edu To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Ken Matsui Subject: [PATCH 2/2] libstdc++: use new built-in trait __is_pointer Date: Sun, 9 Jul 2023 22:23:10 -0700 Message-ID: <20230710052310.48116-2-kmatsui@gcc.gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230710052310.48116-1-kmatsui@gcc.gnu.org> References: <20230710052310.48116-1-kmatsui@gcc.gnu.org> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: dbF4Dp-mHrD_iPilMy31P8dpBYlifdoC X-Proofpoint-GUID: dbF4Dp-mHrD_iPilMy31P8dpBYlifdoC 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-10_04,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 malwarescore=0 clxscore=1034 mlxlogscore=821 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100049 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, RCVD_IN_MSPIKE_H2, 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: INBOX X-GMAIL-THRID: 1771010252115508915 X-GMAIL-MSGID: 1771010252115508915 This patch lets libstdc++ use new built-in trait __is_pointer. libstdc++-v3/ChangeLog: * include/std/type_traits (is_pointer): Use __is_pointer built-in trait. (is_pointer_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_traits | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 0e7a9c9c7f3..d83db98403b 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -515,6 +515,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct is_array<_Tp[]> : public true_type { }; + /// is_pointer +#if __has_builtin(__is_pointer) + template + struct is_pointer + : public __bool_constant<__is_pointer(_Tp)> + { }; +#else template struct __is_pointer_helper : public false_type { }; @@ -523,11 +530,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_pointer_helper<_Tp*> : public true_type { }; - /// is_pointer template struct is_pointer : public __is_pointer_helper<__remove_cv_t<_Tp>>::type { }; +#endif /// is_lvalue_reference template