From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 62BCF3858D20; Mon, 12 Jun 2023 18:09:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62BCF3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f6e68cc738so35155565e9.1; Mon, 12 Jun 2023 11:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686593379; x=1689185379; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ccM4P752pWMaCe4tnoUVTyhBh5uwpgBOFL+lkrZeHYc=; b=dboCorLJeM/E1Jlvm4YgMknwun45jvnpFD3lLt8nlkAvuR8PoKg4FsZULExXbEK9Ow R86JcMhZZ4JBpBuaiwNkUc2w1j33eNq5NPFUk5l2qy9ZOkgJBEyGBNGArV588+R9oL9Z 6XDZ+rKH7sr4CQSfTayRvBdlPK0ohyGElPEG95o9gS8VGSW36pEgIYGr/wCZNvsM5jp1 ZxNDgNfE6Pjho2MauGuvhyNHaXth69bk2Toj5HY5j7NOO86dnazP9sdosilixd6tXazN qzDPQVV6v8KUktxEQiGgcxE2EzZ9UGSXtcJPNj8SDBOKYYA43wNq7qaObtAQ2cTV9z3P uA/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686593379; x=1689185379; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ccM4P752pWMaCe4tnoUVTyhBh5uwpgBOFL+lkrZeHYc=; b=aT8IsZ+a3HaBdljrU9xOXGOFwOWTF+LwdUfDc5uFxNSwpZY4s6DFvoY93nYxhWE+zP QhiYfgzcdGwDnpP4jCfpkAc8JUbikLtf+03smIxIpKG5CkowTiOAV3IU84CDK/HVhNCp z5QDQIiv5dL8k34k1c8irb2Vdyd7sxvr6YLkvJOSwav/2YwyaCz7qb6tKccaqwJmzVNo KmgpXPUiWXLWn24OVK6LYPt0r05v5/qKTwCf3gDjrxJCOHZVQdRyxXyAOGRirSSayok3 +XjwrMHyUcrOQkKKNpUax2GODLnV+clzfHBMqO10Kralh6ofJLa6K6bgmydXKHBZ9WbG WQpg== X-Gm-Message-State: AC+VfDx5Jec9TmVv97qg7yE2NgL/r+OgRMQpEJE0llOLr1ob0KR7HxrC kQG55Z2Uw61fM6VS1erU0CyYny6FbsU= X-Google-Smtp-Source: ACHHUZ67zuLGopCz42prK/bc/6HAmKR3Y69G2M5jei1ae/L0pocy3IooblyGrrAQKozjakn7HPF3cw== X-Received: by 2002:a05:600c:290b:b0:3f5:39:240c with SMTP id i11-20020a05600c290b00b003f50039240cmr6901914wmd.27.1686593378583; Mon, 12 Jun 2023 11:09:38 -0700 (PDT) Received: from [10.25.2.43] ([89.207.171.100]) by smtp.gmail.com with ESMTPSA id v5-20020a05600c214500b003f819faff25sm4821464wml.13.2023.06.12.11.09.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jun 2023 11:09:37 -0700 (PDT) Message-ID: <5c09a61c-9eb0-e858-f4b0-1b338a70d333@gmail.com> Date: Mon, 12 Jun 2023 20:09:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v4 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference To: Ken Matsui , gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org References: <20230402075314.39853-1-kmatsui@cs.washington.edu> <20230611024657.42846-1-kmatsui@cs.washington.edu> <20230611024657.42846-3-kmatsui@cs.washington.edu> Content-Language: en-US From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= In-Reply-To: <20230611024657.42846-3-kmatsui@cs.washington.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 List-Id: Same remark for all your alike patches. On 11/06/2023 04:43, 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. > > Signed-off-by: Ken Matsui > --- > libstdc++-v3/include/std/type_traits | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > index 0e7a9c9c7f3..b2eb4bd3e7f 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) Here you are checking __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 > @@ -3193,11 +3200,7 @@ template > template > inline constexpr bool is_function_v = is_function<_Tp>::value; > 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; > + inline constexpr bool is_reference_v = __is_reference(_Tp); ...but not here, why ?