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 DA7A8385E01F for ; Fri, 8 Mar 2024 17:22:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA7A8385E01F 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 DA7A8385E01F 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=1709918566; cv=none; b=d6wDuwr6E/gsyQVmpYeszn1hYCB9/NPBfDsaolhvN2sWEAAWG1VfZUtLkE6LeFB41QkrQugnxutwczR90E62Ri7ys1ZIDeKjpiSsWRau8XdsXZQd3Remr2no+CamCDFDRGtPrzXhaWbBxGrewRv5gWFeSDyUYt/Ht3+1L4L9CQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709918566; c=relaxed/simple; bh=m+A0mBYn/fjnHEXfWYMnSPnZX/j1tx2PKu0VVliqavQ=; h=DKIM-Signature:From:Date:To:Subject:Message-ID:MIME-Version; b=kiHo+/Mk419O75ovnBSIAqvxzbmiTrDrgkg6/pidiOSXi7LPt+GLIf1Vb0ZB0wssaufRfnKI5PnK3noST3NOWgbJwlizTywU/fALu14RZT9xiKDNl5+syP43siM3/DCM1+KzOMqI1Bfi8pR4diBxyaO2+JU+uH7qD7q3tewUzQc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709918564; 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=Zppk5qNG3qcldwzKXfdOykSvdJsySrBgUN2zR+Uhmyk=; b=BdzjphRteaSK+UtbG7Hhln26b+/8lUhpx07KZqCqHIIkPKi1MpByG6Fb9WsQsCQqDenHQs fUc17vUeH/fS8bqCtkn94JIay7+1Pkm6YTCaXiI/qwiV/dkwbUIPlblGf+x91ZOczxVVXA ZdtImYXZZp2LFtVlGu9cv8+Z9wvG024= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-639-8t0TqKWGOVGLcSdHQlLtQA-1; Fri, 08 Mar 2024 12:22:42 -0500 X-MC-Unique: 8t0TqKWGOVGLcSdHQlLtQA-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-427b56e96a6so26974921cf.3 for ; Fri, 08 Mar 2024 09:22:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709918561; x=1710523361; h=mime-version:references:message-id:in-reply-to:subject:cc:to:date :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Zppk5qNG3qcldwzKXfdOykSvdJsySrBgUN2zR+Uhmyk=; b=S8ZSEHQBAI5atCHgF7f9sCVuYlH9QHYuNRa8fq6PrtkLkRSIYkt0qZUXd6pSeKELB2 EucXCNWqi7VntxHRlz3VjFaAKH4+xv98Xb6zt+kK6DypCjizc7JTGNMzx3uHe6JmtByA WtRvr41R11TgGKI7lRkwStNWOxCTdnPqzCnSsaY2+RLQWidGfnqIqhlgKIrNy6YasYfM Gmu7Fo6tUb38zi1d8971KwuhCQdSHyHhZaCwti6Zw/bOyjBxZ1oXNeGZ6or5cjAO8Kwz dt2r+Dqmwy3HGvcmTmXXWTzqRB2Z+nM8XVewTF+Ml3N2oKrMQQIvrazEEvAUboejfuua wj8g== X-Forwarded-Encrypted: i=1; AJvYcCWIeBqyHVhsl9JTT4utZmx+zj9zB3RCP9T7UXePEKgwiZVhMwp9Sk6UJF/ONsNjp7n5aLK6XLm3zg4tkFWlvBui1qsTY+A= X-Gm-Message-State: AOJu0Yxv2/iWOcwkU+C1zdIsRXZ5791jRi+dHWNPvSTaDsWmybNsgeHt 7HJpW+fEFae3I/lhcnqVpa3Xe4O7/u5bmOp121+4pWJrVsRTETN6kcAf4TkB0k2GCFvoseUfsPg FdcDWsNTp48jOHpgm0DDUbPtP8nd+iIlpwD2iJ897h3UXpMThFf7O6498uhMZ X-Received: by 2002:ac8:7f04:0:b0:42e:701a:ceb8 with SMTP id f4-20020ac87f04000000b0042e701aceb8mr844858qtk.40.1709918561092; Fri, 08 Mar 2024 09:22:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/DxCtNHYOLfvSERkcpB7KlqsoPrrG1h1Arc6EgJ1yt54gHWZbcLFSwAR6+2okZ9W3f0zJ+w== X-Received: by 2002:ac8:7f04:0:b0:42e:701a:ceb8 with SMTP id f4-20020ac87f04000000b0042e701aceb8mr844842qtk.40.1709918560815; Fri, 08 Mar 2024 09:22:40 -0800 (PST) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id n9-20020ac85a09000000b0042efa065946sm4568495qta.6.2024.03.08.09.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 09:22:40 -0800 (PST) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Fri, 8 Mar 2024 12:22:39 -0500 (EST) To: Ken Matsui cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH v14 26/26] libstdc++: Optimize std::is_nothrow_invocable compilation performance In-Reply-To: <20240228192843.188979-27-kmatsui@gcc.gnu.org> Message-ID: <03046523-864b-cf5d-1446-e4a88498b535@idea> References: <20240221093616.4001742-1-kmatsui@gcc.gnu.org> <20240228192843.188979-1-kmatsui@gcc.gnu.org> <20240228192843.188979-27-kmatsui@gcc.gnu.org> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-13.2 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_SORBS_WEB,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 Wed, 28 Feb 2024, 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. > > 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 9af233bcc75..093d85a51a8 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -3265,8 +3265,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" } Is the error coming somewhere from the new build_invoke function? That'd be surprising since we pass tf_none to it, which should suppress such errors. (You can probably break on cxx_incomplete_type_diagnostic to find out where it's coming from.) > > #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 > >