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 85CE4385800D for ; Thu, 4 Jan 2024 21:50:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 85CE4385800D 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 85CE4385800D 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=1704405049; cv=none; b=QosnGsjhxwcNUToMY9sUt7Js+ZYwwyt/zxDS1I5J7Jp7ziHXfVcA4p7S3pbA9Ja3YOHBYrByviBNJub4acOIHTOmOdsam3TINCcl70x9OrsdFnduFmKQ5qc+70caA8pg6a7CWcciexpf0mQYS9siOlw615VtVXUnyS+DeSjF458= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704405049; c=relaxed/simple; bh=/XquSCJqksnv8iwbtX6YZRt7bkDNg1vbLk2pUUq3+T0=; h=DKIM-Signature:From:Date:To:Subject:Message-ID:MIME-Version; b=cCt1EPpEIU8vG83wUoss4mmz9aI7C5WrjjijNyjGcCSJdImzibCfkCO89w6yokGyeaDfUqJJBbOTivbEcZbEYmjPgvCakdwJwrOlgxleOgaBbUTw10lbgb3FkVlgQOD3HFDyk+XfzTonpV/f9y9+B7xZFyEuE3tLdPDjlx4xJoo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704405046; 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=zwozvgSEt/n1vfUruMSb5sEFaGhUAV+s13xQi9a1mpU=; b=fsYIm/NOkHrvwgKRuvNe00c+JCj6omKng9emxzpNG5ZwfvAmqMN8Zqqkfu7Ls2TCKvylEw DreHx6sQ5Z9U2Fv9zVFJUptFgh05qTjeVNBV2UxaQI8sfbbK43RRfdsc+SNsjeax9f8yg+ AJaNoPZPk2UNohsjRowjHw9YPx6kuaA= Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-227--RyHrpYJOueOXU7iDX0dsg-1; Thu, 04 Jan 2024 16:50:40 -0500 X-MC-Unique: -RyHrpYJOueOXU7iDX0dsg-1 Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-1ef4f8d294eso1085145fac.1 for ; Thu, 04 Jan 2024 13:50:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704405038; x=1705009838; 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=zwozvgSEt/n1vfUruMSb5sEFaGhUAV+s13xQi9a1mpU=; b=CgSpHHXLDcZKxynIgsuQzD1K+PtSkG0NQBDA5uU47h1/G0VVGf0S6UUA46ROE7vDrX UQmuTliYDSMhh0ofPdkbI628+wUm0p/7j66zrfsus12kKPIKa2Mwqt9C9L5KYQm9XkHV Iud+bCmWWDf2581jnV7kl+SO5s/uMJoZXL4BFdv/7yMhAjxPg9lHmW7TOxz92o7ZK+RC jQcEPzGitI0JPrvkBUkRRT5I27UI7bf/lWV7l0DUdNyxFDp56JZGhx/CDprV+DtM4nSf VEG37+JQFGoSMS7/TqEnKpk0cqsIxqgcSqzDz4Er6ZuVRyOrHChywwmhTd6egyOmg7GO iFfw== X-Gm-Message-State: AOJu0Yxx9WC5D6a802d2E5PpzZpnBSMIrjYFenJJkH7b4hU44k2wNaDm D8HBVp9L3ESix1qo3z9i0gDctq0YQz5s4aPOzx0rdfrur72EaAw0rX87fbH9l0b4gLzt+a7FyG9 BGrBI17En2N50A0c0Y4kozg8/Yx0qA10= X-Received: by 2002:a05:6870:4191:b0:203:f666:afef with SMTP id y17-20020a056870419100b00203f666afefmr1267426oac.33.1704405038578; Thu, 04 Jan 2024 13:50:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdWCIxOCmnARpYZv/4Fh3Y+vx/hMT5bjgLXbuo1fbuJxaMv5JtH3CPWwhagIwCYaXV5Dh7jQ== X-Received: by 2002:a05:6870:4191:b0:203:f666:afef with SMTP id y17-20020a056870419100b00203f666afefmr1267420oac.33.1704405038342; Thu, 04 Jan 2024 13:50:38 -0800 (PST) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id n10-20020a05620a222a00b0077d7326c60csm113055qkh.38.2024.01.04.13.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 13:50:37 -0800 (PST) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Thu, 4 Jan 2024 16:50:37 -0500 (EST) To: Ken Matsui cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org, Patrick Palka Subject: Re: [PATCH v2] libstdc++: Use _GLIBCXX_USE_BUILTIN_TRAIT In-Reply-To: <20231223230558.849031-1-kmatsui@gcc.gnu.org> Message-ID: References: <20230911152703.22436-1-kmatsui@gcc.gnu.org> <20231223230558.849031-1-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=-14.3 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_H4,RCVD_IN_MSPIKE_WL,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 Sat, 23 Dec 2023, Ken Matsui wrote: > This patch uses _GLIBCXX_USE_BUILTIN_TRAIT macro instead of __has_builtin > in the type_traits header for traits that have a corresponding fallback > non-built-in implementation. This macro supports to toggle the use of > built-in traits in the type_traits header through > _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS macro, without needing to modify the > source code. LGTM, thanks! > > libstdc++-v3/ChangeLog: > > * include/std/type_traits: Use _GLIBCXX_USE_BUILTIN_TRAIT. > > Signed-off-by: Ken Matsui > Reviewed-by: Patrick Palka > --- > libstdc++-v3/include/std/type_traits | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits > index f00c07f94f9..ba35ffb27fa 100644 > --- a/libstdc++-v3/include/std/type_traits > +++ b/libstdc++-v3/include/std/type_traits > @@ -1481,7 +1481,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > : public __bool_constant<__is_base_of(_Base, _Derived)> > { }; > > -#if __has_builtin(__is_convertible) > +#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible) > template > struct is_convertible > : public __bool_constant<__is_convertible(_From, _To)> > @@ -1531,7 +1531,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > #ifdef __cpp_lib_is_nothrow_convertible // C++ >= 20 > > -#if __has_builtin(__is_nothrow_convertible) > +#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_convertible) > /// is_nothrow_convertible_v > template > inline constexpr bool is_nothrow_convertible_v > @@ -1606,7 +1606,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > { using type = _Tp; }; > > /// remove_cv > -#if __has_builtin(__remove_cv) > +#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cv) > template > struct remove_cv > { using type = __remove_cv(_Tp); }; > @@ -1672,7 +1672,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > // Reference transformations. > > /// remove_reference > -#if __has_builtin(__remove_reference) > +#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_reference) > template > struct remove_reference > { using type = __remove_reference(_Tp); }; > @@ -3537,7 +3537,7 @@ template > * @{ > */ > #ifdef __cpp_lib_remove_cvref // C++ >= 20 > -# if __has_builtin(__remove_cvref) > +# if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cvref) > template > struct remove_cvref > { using type = __remove_cvref(_Tp); }; > -- > 2.43.0 > >