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.133.124]) by sourceware.org (Postfix) with ESMTPS id BE5B63857709 for ; Tue, 20 Jun 2023 16:07:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE5B63857709 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=1687277240; 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=uB3Tu8zzEMtW+c+BBuQOMQg14qPJYr9lFWKNLcHjj7Q=; b=JXRgte8iZVKUi/6RwYRvVh/C8ok4KSJGZxnGp1DjuZRjUXoMyqE/YttrFkPSAvWy0sAD3G GF6ARAvrVNUmDq74TYtj1sX34csEBxF7hHtyWsPBlZ1oPOPtiITYkrRldhUOLQ92taqQvW FCNaOk6P5mIykLQR7B7T0MiQtENXMLc= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-536-Xa3FefFNN_uQcUUxwcjirg-1; Tue, 20 Jun 2023 12:07:10 -0400 X-MC-Unique: Xa3FefFNN_uQcUUxwcjirg-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-62ff6cf5b06so54277086d6.3 for ; Tue, 20 Jun 2023 09:07:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687277223; x=1689869223; 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=uB3Tu8zzEMtW+c+BBuQOMQg14qPJYr9lFWKNLcHjj7Q=; b=h5KB0Gm2NCeaC6rZolkUeg5/WSLWaPRuQI2n+YM66y8yx33D+nGa+3mgL1AVrk+plB P2d9s7XLqlzjkuT93w14ZRIL46At6Zh3rFouo2WNjB4TqNZFzcJJ6C07tRDM8nuK3rbt lbZFjphzmHWUxidW05B+ienrbaGojWjY0kJ/oWmtRTpepMgVx+QqqlKN/NE7wUHuBN1j /d5GbpvBn/8I30ovs2knQ1NNv+jIQGOPR6KM6t2IBsUikwNhoIm7ycaHe9FQ757N2yqF Tc3IbatXE6IP0irE9AvEIFUERsZzGwVXP5ycz0FXQyfurD+OunLtBRy3/yBYD/4YsxQx /PKQ== X-Gm-Message-State: AC+VfDyJ7VToEKvmnfwyVuG0DLE6bgUtqbMgVYPCnmUMfN/+9oTmDvAl Ph3HSZUn2BU/qc/UTYKVJ7u+CQ8Wg3KoFqrBuyHkSjZGCsH2GgJXUJ/1v//AUhlxX4eqQ7gIVT2 vSwkEOXWQ6Fk9Xc/XAlhYL/Fbow== X-Received: by 2002:a05:6214:248d:b0:630:21a6:bb51 with SMTP id gi13-20020a056214248d00b0063021a6bb51mr7352555qvb.46.1687277222963; Tue, 20 Jun 2023 09:07:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5dsOisJKP3omzecyxTAdGcCQhAP//cP9XxXfZRrOupnLcmT6FwE6CxgXElIB4dU20GB93yzQ== X-Received: by 2002:a05:6214:248d:b0:630:21a6:bb51 with SMTP id gi13-20020a056214248d00b0063021a6bb51mr7352529qvb.46.1687277222569; Tue, 20 Jun 2023 09:07:02 -0700 (PDT) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id p6-20020a0cf546000000b00623819de804sm1370142qvm.127.2023.06.20.09.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 09:07:02 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Tue, 20 Jun 2023 12:07:01 -0400 (EDT) To: Ken Matsui cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH v7 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference In-Reply-To: <20230612224909.21188-3-kmatsui@cs.washington.edu> Message-ID: <99f70a7e-9f5f-fbe2-78c2-524012eefab6@idea> References: <20230612224109.20749-1-kmatsui@cs.washington.edu> <20230612224909.21188-1-kmatsui@cs.washington.edu> <20230612224909.21188-3-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=-13.8 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,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On Mon, 12 Jun 2023, Ken Matsui via Libstdc++ wrote: > This patch gets std::is_reference to dispatch to new built-in trait > __is_reference. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_reference): Use __is_reference built-in > trait. > (is_reference_v): Likewise. LGTM > > Signed-off-by: Ken Matsui > --- > libstdc++-v3/include/std/type_traits | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > index 0e7a9c9c7f3..2a14df7e5f9 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -639,6 +639,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > // Composite type categories. > > /// is_reference > +#if __has_builtin(__is_reference) > + template > + struct is_reference > + : public __bool_constant<__is_reference(_Tp)> > + { }; > +#else > template > struct is_reference > : public false_type > @@ -653,6 +659,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > struct is_reference<_Tp&&> > : public true_type > { }; > +#endif > > /// is_arithmetic > template > @@ -3192,12 +3199,19 @@ template > inline constexpr bool is_class_v = __is_class(_Tp); > template > inline constexpr bool is_function_v = is_function<_Tp>::value; > + > +#if __has_builtin(__is_reference) > +template > + inline constexpr bool is_reference_v = __is_reference(_Tp); > +#else > template > inline constexpr bool is_reference_v = false; > template > inline constexpr bool is_reference_v<_Tp&> = true; > template > inline constexpr bool is_reference_v<_Tp&&> = true; > +#endif > + > template > inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value; > template > -- > 2.41.0 > >