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 EBC233858D3C for ; Fri, 9 Jun 2023 17:54:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBC233858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686333287; 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=gStm4KYA2kL4HiG8QyUtS1xyTLAysY5/YLppk+/my5U=; b=ZPkS0CEMjuWfa+cRLdI5eeFTXJoVhP/58J064A7X0UNczns8aaQTWOFeLWEFJwbb9irpvw VNEoG3tKaFvqHQXC7KLFsmWJxTjaa3gcfTZsOwub6LMug4Zl/QIn+GGmONGwON10de6vk6 H6ZgQnexR5BUV5R1nY4zOnPiL2zuY5w= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-407-rAXCIWMbMieOhRJwfeAcwQ-1; Fri, 09 Jun 2023 13:54:46 -0400 X-MC-Unique: rAXCIWMbMieOhRJwfeAcwQ-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-75d540855c5so268491985a.0 for ; Fri, 09 Jun 2023 10:54:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686333286; x=1688925286; 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=gStm4KYA2kL4HiG8QyUtS1xyTLAysY5/YLppk+/my5U=; b=Vinxw8Yqt9XBcOb1CTweHqbshVwoWksEVqCmNoaB0HLZf1yGfwLJfxZvCMZ8wHgCMj 4MEqp0QykHW/1g+XEozlyR+MrBcrDHMPH574IMA/wDL2t+uFXaQWKX9Pb8lUrDK758yP 3jMK7Qz4dj4ZLeHVq1HpZMSVamyatLZPSQYNI47yMzXuMXVMczb9KZcqSfAHmBAMMhGQ CAot6QT265BAbr1nt2GIpRfFni5bFeUgoFrR+Yrn+KeVmrNRu1voDFhzpuHbJYBR2EtJ PbeZe9RlHs4kHYyQyb3J2GqW9mX8EHiEY9detNX3bmqf2Mt4izATiS6sLR0Ntd5NJo/T hCeQ== X-Gm-Message-State: AC+VfDyayhzn4lK9oJOIoM5ChFETGjDGJHDc71sWVIcTm/Mt742/e++w 1cxXpIEuBbkeRvHS7a2xUuFpsI5LXdfOjrSZjxpQqdLvnkGoGtvAKQDbqISY7D04bSmrLR9pQgc oZJcRGLKhpuTEKaE= X-Received: by 2002:a05:620a:1d08:b0:75b:23a0:e7c8 with SMTP id dl8-20020a05620a1d0800b0075b23a0e7c8mr2157371qkb.41.1686333285934; Fri, 09 Jun 2023 10:54:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5s/tJZi4nObFs6s3Ld1uwl2p/5JC1is+F+UDncMgd1i4FKqGkNEL7f7bUOA8mOpCUzJr1rQw== X-Received: by 2002:a05:620a:1d08:b0:75b:23a0:e7c8 with SMTP id dl8-20020a05620a1d0800b0075b23a0e7c8mr2157353qkb.41.1686333285606; Fri, 09 Jun 2023 10:54:45 -0700 (PDT) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id c23-20020a05620a135700b0074e0abe59a0sm1169686qkl.78.2023.06.09.10.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 10:54:45 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Fri, 9 Jun 2023 13:54:44 -0400 (EDT) To: Ken Matsui cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH v3 4/6] libstdc++: use new built-in trait __is_function for std::is_function In-Reply-To: <20230402075314.39853-5-kmatsui@cs.washington.edu> Message-ID: <80fa68bb-8849-f5f8-328a-5e3404f1ae12@idea> References: <20230330183911.12640-1-kmatsui@cs.washington.edu> <20230402075314.39853-1-kmatsui@cs.washington.edu> <20230402075314.39853-5-kmatsui@cs.washington.edu> 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=-14.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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 Sun, 2 Apr 2023, Ken Matsui via Gcc-patches wrote: > This patch gets std::is_function to dispatch to new built-in trait > __is_function. For std::is_function and other predicate-like type traits, I think we also want to make the corresponding variable template is_function_v directly use the built-in too. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_function): Use __is_function built-in > trait. > > Signed-off-by: Ken Matsui > --- > libstdc++-v3/include/std/type_traits | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > index 58a732735c8..9eafd6b16f2 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 > > -- > 2.40.0 > >