From patchwork Sun Jun 11 02:43:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Matsui X-Patchwork-Id: 106041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1834478vqr; Sat, 10 Jun 2023 19:53:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sYMdGcF1lOS1ckOlAxy4fTnfudYK92WgPHVo+h97jOcUMa8C90WGj5XrZzSKBqGAa4Kms X-Received: by 2002:a17:906:99c4:b0:974:6216:8dd2 with SMTP id s4-20020a17090699c400b0097462168dd2mr7651603ejn.27.1686451993922; Sat, 10 Jun 2023 19:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686451993; cv=none; d=google.com; s=arc-20160816; b=z7RPJTjMrAca9Sn97oplO2NasyygKax1ZrJnNIfGz9eSVGG5rPd0RVrCUDgNGClunf UoUmZxT95xmp41hL7TSn7DLmfxviDhJkUfzZwWETjM3xOH32h2BMPJPiOV3x92AutzFW IOssC607we31Pnke8M7bB0nvsg6ifxhjzn0TsLhYotnLW3w3DvOcK/vA8kYQghwjfwJ2 b/+ZKkUKMD1By1OdmJygGw9u492NC7I5/bE9wOaxvScpqlMM1NHX15K0ABubPZH6ISX+ cvYqBeh8b4GrO5nxhUvUSbOPvr1QH4cxfotDCvNdLq9gTHaWnm3aF/E6ZZpuJQnNSzeq 7xyg== 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=k+5lVVkC5TFhKSsVfoKiNcON/vrdiXXKZkd2qudGSZo=; b=kwedrzl3vfh4Pnx+s9LZqvUYZHbcdtWzR0kXxcUSA+KmO/ReJJsENWMrB8Uusp83tQ 60Gmsk7AMsBEjsy4KHR/9uSGDscZZZLaxJ0/JVepJZafPt0fp+99FyKDFaYL4l5FefQg ircJSIGqROQzJ8cGdY/xXLq4HNZGDmwakWj4D1IG4klzG0haisn9SWNKFAxDgsclJx4b k0lfewtMMW2plu28FWQXnYADiKSuVoWBBP5k0hALph2/po8MjEUJ5TqTQJB1ywhWehOB Bv9ujo4H9Wpavl/pKgWTEaiVXSdnOhSiwGxKjOuNNLksNMdOQEr+1jFDfwxdNg8FXutl RDRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bKfU5Btc; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id oy30-20020a170907105e00b00978a23d0adcsi3521583ejb.211.2023.06.10.19.53.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 19:53:13 -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=bKfU5Btc; 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 C7C7B385C6FA for ; Sun, 11 Jun 2023 02:51:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7C7B385C6FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686451870; bh=k+5lVVkC5TFhKSsVfoKiNcON/vrdiXXKZkd2qudGSZo=; 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=bKfU5Btc3LCU/ptmLE+8wSY5jAAlS9FvQxEKHzJsdLhqltc0tz62xD9RT2KITFCNE TkIa11fQrxN9BbZGzKFiJqGM0saJ3c8mCqgYyOzo6Szjs8ggs4VAJ3THj8eOYWD3Jj lGfPtGy33oQJ02Vgk+me+0pTpnZ8Nq2UIj0GCTFU= 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 6B265384D1A9; Sun, 11 Jun 2023 02:49:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B265384D1A9 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 35B2noH8010270; Sun, 11 Jun 2023 02:49:50 GMT Received: from mxout21.s.uw.edu (mxout21.s.uw.edu [140.142.32.139]) by mx0a-00641c01.pphosted.com (PPS) with ESMTPS id 3r52sn0fuq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 11 Jun 2023 02:49:49 +0000 Received: from smtp.washington.edu (smtp.washington.edu [128.208.60.132]) by mxout21.s.uw.edu (8.14.4+UW20.07/8.14.4+UW22.04) with ESMTP id 35B2nG3E005530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Jun 2023 19:49:16 -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 35B2l2eF007901 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sat, 10 Jun 2023 19:49:16 -0700 X-UW-Orig-Sender: kmatsui@smtp.washington.edu To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Ken Matsui Subject: [PATCH v4 4/6] libstdc++: use new built-in trait __is_function for std::is_function Date: Sat, 10 Jun 2023 19:43:11 -0700 Message-ID: <20230611024657.42846-5-kmatsui@cs.washington.edu> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230611024657.42846-1-kmatsui@cs.washington.edu> References: <20230402075314.39853-1-kmatsui@cs.washington.edu> <20230611024657.42846-1-kmatsui@cs.washington.edu> MIME-Version: 1.0 X-Proofpoint-GUID: xClJntbvQK3R4U48x1dajwJeK_epc2Eo X-Proofpoint-ORIG-GUID: xClJntbvQK3R4U48x1dajwJeK_epc2Eo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-10_18,2023-06-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 spamscore=0 mlxlogscore=829 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306110024 X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, 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?1761403780011068317?= X-GMAIL-MSGID: =?utf-8?q?1768373085801124267?= This patch gets std::is_function to dispatch to new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_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 b2eb4bd3e7f..c0fa748da2e 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -594,6 +594,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { }; /// is_function +#if __has_builtin(__is_function) + template + struct is_function + : public __bool_constant<__is_function(_Tp)> + { }; +#else template struct is_function : public __bool_constant::value> { }; @@ -605,6 +611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct is_function<_Tp&&> : public false_type { }; +#endif #define __cpp_lib_is_null_pointer 201309L @@ -3198,7 +3205,7 @@ template template inline constexpr bool is_class_v = __is_class(_Tp); template - inline constexpr bool is_function_v = is_function<_Tp>::value; + inline constexpr bool is_function_v = __is_function(_Tp); template inline constexpr bool is_reference_v = __is_reference(_Tp); template