public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ken Matsui <kmatsui@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r14-6929] libstdc++: Use _GLIBCXX_USE_BUILTIN_TRAIT
Date: Fri,  5 Jan 2024 00:17:25 +0000 (GMT)	[thread overview]
Message-ID: <20240105001726.04FEB385800D@sourceware.org> (raw)

https://gcc.gnu.org/g:f151db0f0ea48c2624baf258dca7ae232896ebf4

commit r14-6929-gf151db0f0ea48c2624baf258dca7ae232896ebf4
Author: Ken Matsui <kmatsui@gcc.gnu.org>
Date:   Mon Sep 11 08:21:50 2023 -0700

    libstdc++: Use _GLIBCXX_USE_BUILTIN_TRAIT
    
    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.
    
    libstdc++-v3/ChangeLog:
    
            * include/std/type_traits: Use _GLIBCXX_USE_BUILTIN_TRAIT.
    
    Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
    Reviewed-by: Patrick Palka <ppalka@redhat.com>
    Reviewed-by: Jonathan Wakely <jwakely@redhat.com>

Diff:
---
 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 217cfac13a8..a71162b33ec 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<typename _From, typename _To>
     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<typename _From, typename _To>
     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<typename _Tp>
     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<typename _Tp>
     struct remove_reference
     { using type = __remove_reference(_Tp); };
@@ -3537,7 +3537,7 @@ template<typename _Ret, typename _Fn, typename... _Args>
    * @{
    */
 #ifdef __cpp_lib_remove_cvref // C++ >= 20
-# if __has_builtin(__remove_cvref)
+# if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cvref)
   template<typename _Tp>
     struct remove_cvref
     { using type = __remove_cvref(_Tp); };

                 reply	other threads:[~2024-01-05  0:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240105001726.04FEB385800D@sourceware.org \
    --to=kmatsui@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).