From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 3C5C23882052 for ; Thu, 13 Jun 2024 12:42:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C5C23882052 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3C5C23882052 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718282564; cv=none; b=uhfSW0F0YJeeabQxj+m3RsJ6+AQEIuPDnCyCXJz32KJ9kpL1FLzCcIy2sngtcpQgzSGrDLWwUXFVJrRotfE6Y5TaYU6HRLMe0CvPwwELu/zLqP5idr6SRhw2wTKI93tjNF8TExKq46ZAC3U/UxOZQiN6WsmFDilqbFhUPtPvK5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718282564; c=relaxed/simple; bh=oWj2s+nVNfijZx1TCuZ6V5fYG5aXkWFQvgsde8vMxbQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=ug3JtlPwSAG8T2VMjNZFTuTARGev1fAUnqlhnxPaq1LaeX3oZ4eiLgxhWEMkNpVe+C+nsUkE6MRDLbMrUyGYjzH5wnnwYVzxlLN/Ut4Mu4hIwUDsD34nczr4MkgQdJQbIbWIosRs57wNOtwDZDeuPufS1PLsXbEKZcSKsigC5E4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718282561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AFtpCo+o+EURK1/jKjAtP6BvOLylePqm2PvOUS6SQtg=; b=CLhTK31dB3G1GpKz0ueq2ZKzDrD/rCMiSTWgMPnyFx2sMJehU/upO8lqn2e0lrvf+OfByi kMNshzFuEzLniMRN8G/Y+8txHe0SVpUfMYYtdyglZWijWGBC9rdOv2rCaGJIrmcF8PNBUV imYFxycj8y53v2JRRY/z7osOA16QGUk= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-XMIo1vhMMpWhcwyx06-vtw-1; Thu, 13 Jun 2024 08:42:38 -0400 X-MC-Unique: XMIo1vhMMpWhcwyx06-vtw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1F4E61956055; Thu, 13 Jun 2024 12:42:37 +0000 (UTC) Received: from localhost (unknown [10.39.192.128]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9D3421956087; Thu, 13 Jun 2024 12:42:36 +0000 (UTC) Date: Thu, 13 Jun 2024 13:42:35 +0100 From: Jonathan Wakely To: Ken Matsui Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH v26 13/13] libstdc++: Optimize std::is_nothrow_invocable compilation performance Message-ID: References: <20240510161405.194750-21-kmatsui@gcc.gnu.org> <20240511090130.248174-1-kmatsui@gcc.gnu.org> <20240511090130.248174-13-kmatsui@gcc.gnu.org> MIME-Version: 1.0 In-Reply-To: <20240511090130.248174-13-kmatsui@gcc.gnu.org> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/05/24 02:01 -0700, Ken Matsui wrote: >This patch optimizes the compilation performance of >std::is_nothrow_invocable by dispatching to the new >__is_nothrow_invocable built-in trait. OK, thanks. >libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_nothrow_invocable): Use > __is_nothrow_invocable built-in trait. > * testsuite/20_util/is_nothrow_invocable/incomplete_args_neg.cc: > Handle the new error from __is_nothrow_invocable. > * testsuite/20_util/is_nothrow_invocable/incomplete_neg.cc: > Likewise. > >Signed-off-by: Ken Matsui >--- > libstdc++-v3/include/std/type_traits | 4 ++++ > .../20_util/is_nothrow_invocable/incomplete_args_neg.cc | 1 + > .../testsuite/20_util/is_nothrow_invocable/incomplete_neg.cc | 1 + > 3 files changed, 6 insertions(+) > >diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits >index 502032787bd..a046560c178 100644 >--- a/libstdc++-v3/include/std/type_traits >+++ b/libstdc++-v3/include/std/type_traits >@@ -3269,8 +3269,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > /// std::is_nothrow_invocable > template > struct is_nothrow_invocable >+#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable) >+ : public __bool_constant<__is_nothrow_invocable(_Fn, _ArgTypes...)> >+#else > : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>, > __call_is_nothrow_<_Fn, _ArgTypes...>>::type >+#endif > { > static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}), > "_Fn must be a complete class or an unbounded array"); >diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/incomplete_args_neg.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/incomplete_args_neg.cc >index 3c225883eaf..3f8542dd366 100644 >--- a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/incomplete_args_neg.cc >+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/incomplete_args_neg.cc >@@ -18,6 +18,7 @@ > // . > > // { dg-error "must be a complete class" "" { target *-*-* } 0 } >+// { dg-prune-output "invalid use of incomplete type" } > > #include > >diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/incomplete_neg.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/incomplete_neg.cc >index 5a728bfa03b..d3bdf08448b 100644 >--- a/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/incomplete_neg.cc >+++ b/libstdc++-v3/testsuite/20_util/is_nothrow_invocable/incomplete_neg.cc >@@ -18,6 +18,7 @@ > // . > > // { dg-error "must be a complete class" "" { target *-*-* } 0 } >+// { dg-prune-output "invalid use of incomplete type" } > > #include > >-- >2.44.0 >