public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: use __bool_constant instead of integral_constant
@ 2023-03-23  2:04 Ken Matsui
  2023-03-23  9:28 ` Jonathan Wakely
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Matsui @ 2023-03-23  2:04 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++, Ken Matsui

In the type_traits header, both integral_constant<bool> and __bool_constant
are used. This patch unifies those usages into __bool_constant.

libstdc++-v3/ChangeLog:

	* include/std/type_traits: Use __bool_constant instead of
	integral_constant.
---
 libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 2bd607a8b8f..bc6982f9e64 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_enum
   template<typename _Tp>
     struct is_enum
-    : public integral_constant<bool, __is_enum(_Tp)>
+    : public __bool_constant<__is_enum(_Tp)>
     { };
 
   /// is_union
   template<typename _Tp>
     struct is_union
-    : public integral_constant<bool, __is_union(_Tp)>
+    : public __bool_constant<__is_union(_Tp)>
     { };
 
   /// is_class
   template<typename _Tp>
     struct is_class
-    : public integral_constant<bool, __is_class(_Tp)>
+    : public __bool_constant<__is_class(_Tp)>
     { };
 
   /// is_function
@@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_trivial
   template<typename _Tp>
     struct is_trivial
-    : public integral_constant<bool, __is_trivial(_Tp)>
+    : public __bool_constant<__is_trivial(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_trivially_copyable
   template<typename _Tp>
     struct is_trivially_copyable
-    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
+    : public __bool_constant<__is_trivially_copyable(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_standard_layout
   template<typename _Tp>
     struct is_standard_layout
-    : public integral_constant<bool, __is_standard_layout(_Tp)>
+    : public __bool_constant<__is_standard_layout(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct
     _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
     is_pod
-    : public integral_constant<bool, __is_pod(_Tp)>
+    : public __bool_constant<__is_pod(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct
     _GLIBCXX17_DEPRECATED
     is_literal_type
-    : public integral_constant<bool, __is_literal_type(_Tp)>
+    : public __bool_constant<__is_literal_type(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_empty
   template<typename _Tp>
     struct is_empty
-    : public integral_constant<bool, __is_empty(_Tp)>
+    : public __bool_constant<__is_empty(_Tp)>
     { };
 
   /// is_polymorphic
   template<typename _Tp>
     struct is_polymorphic
-    : public integral_constant<bool, __is_polymorphic(_Tp)>
+    : public __bool_constant<__is_polymorphic(_Tp)>
     { };
 
 #if __cplusplus >= 201402L
@@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// @since C++14
   template<typename _Tp>
     struct is_final
-    : public integral_constant<bool, __is_final(_Tp)>
+    : public __bool_constant<__is_final(_Tp)>
     { };
 #endif
 
   /// is_abstract
   template<typename _Tp>
     struct is_abstract
-    : public integral_constant<bool, __is_abstract(_Tp)>
+    : public __bool_constant<__is_abstract(_Tp)>
     { };
 
   /// @cond undocumented
@@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Tp>
     struct __is_signed_helper<_Tp, true>
-    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
+    : public __bool_constant<_Tp(-1) < _Tp(0)>
     { };
   /// @endcond
 
@@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// has_virtual_destructor
   template<typename _Tp>
     struct has_virtual_destructor
-    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
+    : public __bool_constant<__has_virtual_destructor(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp, typename _Up>
     struct is_same
 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
-    : public integral_constant<bool, __is_same(_Tp, _Up)>
+    : public __bool_constant<__is_same(_Tp, _Up)>
 #else
     : public false_type
 #endif
@@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_base_of
   template<typename _Base, typename _Derived>
     struct is_base_of
-    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
+    : public __bool_constant<__is_base_of(_Base, _Derived)>
     { };
 
 #if __has_builtin(__is_convertible)
-- 
2.40.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23  2:04 [PATCH] libstdc++: use __bool_constant instead of integral_constant Ken Matsui
@ 2023-03-23  9:28 ` Jonathan Wakely
  2023-03-23 10:17   ` Ken Matsui
  0 siblings, 1 reply; 14+ messages in thread
From: Jonathan Wakely @ 2023-03-23  9:28 UTC (permalink / raw)
  To: Ken Matsui; +Cc: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 6378 bytes --]

On Thu, 23 Mar 2023 at 02:06, Ken Matsui via Libstdc++ <
libstdc++@gcc.gnu.org> wrote:

> In the type_traits header, both integral_constant<bool> and __bool_constant
> are used.


Yes, this is just because we didn't have __bool_constant originally, and
nobody has needed to touch the traits that still use integral_constant, so
they never got updated.



> This patch unifies those usages into __bool_constant.
>

Thanks, doing this for consistency seems reasonable, and safe to do now
instead of waiting until after the GCC 13 release. I'll test and push the
patch.

Do you have a GCC copyright assignment on file with the FSF?
If not, either you need to complete that paperwork, or add a DCO sign-off
to all your patches:
https://gcc.gnu.org/dco.html


>
> libstdc++-v3/ChangeLog:
>
>         * include/std/type_traits: Use __bool_constant instead of
>         integral_constant.
> ---
>  libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/libstdc++-v3/include/std/type_traits
> b/libstdc++-v3/include/std/type_traits
> index 2bd607a8b8f..bc6982f9e64 100644
> --- a/libstdc++-v3/include/std/type_traits
> +++ b/libstdc++-v3/include/std/type_traits
> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_enum
>    template<typename _Tp>
>      struct is_enum
> -    : public integral_constant<bool, __is_enum(_Tp)>
> +    : public __bool_constant<__is_enum(_Tp)>
>      { };
>
>    /// is_union
>    template<typename _Tp>
>      struct is_union
> -    : public integral_constant<bool, __is_union(_Tp)>
> +    : public __bool_constant<__is_union(_Tp)>
>      { };
>
>    /// is_class
>    template<typename _Tp>
>      struct is_class
> -    : public integral_constant<bool, __is_class(_Tp)>
> +    : public __bool_constant<__is_class(_Tp)>
>      { };
>
>    /// is_function
> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_trivial
>    template<typename _Tp>
>      struct is_trivial
> -    : public integral_constant<bool, __is_trivial(_Tp)>
> +    : public __bool_constant<__is_trivial(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_trivially_copyable
>    template<typename _Tp>
>      struct is_trivially_copyable
> -    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
> +    : public __bool_constant<__is_trivially_copyable(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_standard_layout
>    template<typename _Tp>
>      struct is_standard_layout
> -    : public integral_constant<bool, __is_standard_layout(_Tp)>
> +    : public __bool_constant<__is_standard_layout(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>      struct
>      _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
>      is_pod
> -    : public integral_constant<bool, __is_pod(_Tp)>
> +    : public __bool_constant<__is_pod(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>      struct
>      _GLIBCXX17_DEPRECATED
>      is_literal_type
> -    : public integral_constant<bool, __is_literal_type(_Tp)>
> +    : public __bool_constant<__is_literal_type(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_empty
>    template<typename _Tp>
>      struct is_empty
> -    : public integral_constant<bool, __is_empty(_Tp)>
> +    : public __bool_constant<__is_empty(_Tp)>
>      { };
>
>    /// is_polymorphic
>    template<typename _Tp>
>      struct is_polymorphic
> -    : public integral_constant<bool, __is_polymorphic(_Tp)>
> +    : public __bool_constant<__is_polymorphic(_Tp)>
>      { };
>
>  #if __cplusplus >= 201402L
> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// @since C++14
>    template<typename _Tp>
>      struct is_final
> -    : public integral_constant<bool, __is_final(_Tp)>
> +    : public __bool_constant<__is_final(_Tp)>
>      { };
>  #endif
>
>    /// is_abstract
>    template<typename _Tp>
>      struct is_abstract
> -    : public integral_constant<bool, __is_abstract(_Tp)>
> +    : public __bool_constant<__is_abstract(_Tp)>
>      { };
>
>    /// @cond undocumented
> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>
>    template<typename _Tp>
>      struct __is_signed_helper<_Tp, true>
> -    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
> +    : public __bool_constant<_Tp(-1) < _Tp(0)>
>      { };
>    /// @endcond
>
> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// has_virtual_destructor
>    template<typename _Tp>
>      struct has_virtual_destructor
> -    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
> +    : public __bool_constant<__has_virtual_destructor(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    template<typename _Tp, typename _Up>
>      struct is_same
>  #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
> -    : public integral_constant<bool, __is_same(_Tp, _Up)>
> +    : public __bool_constant<__is_same(_Tp, _Up)>
>  #else
>      : public false_type
>  #endif
> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_base_of
>    template<typename _Base, typename _Derived>
>      struct is_base_of
> -    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
> +    : public __bool_constant<__is_base_of(_Base, _Derived)>
>      { };
>
>  #if __has_builtin(__is_convertible)
> --
> 2.40.0
>
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23  9:28 ` Jonathan Wakely
@ 2023-03-23 10:17   ` Ken Matsui
  2023-03-23 10:46     ` Ville Voutilainen
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Matsui @ 2023-03-23 10:17 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches, libstdc++

Thank you so much for your review!

This is my first time contributing to GCC, so I do not have a GCC
copyright assignment. I googled those two ways, but I am still
confused... Is it correct that the DCO sign-off has been getting more
common recently? If so, I will put the sign-off into all my patches. I
would prefer to choose the more common and lightweight way.

Sincerely,
Ken Matsui

On Thu, Mar 23, 2023 at 2:28 AM Jonathan Wakely <jwakely@redhat.com> wrote:
>
>
>
> On Thu, 23 Mar 2023 at 02:06, Ken Matsui via Libstdc++ <libstdc++@gcc.gnu.org> wrote:
>>
>> In the type_traits header, both integral_constant<bool> and __bool_constant
>> are used.
>
>
> Yes, this is just because we didn't have __bool_constant originally, and nobody has needed to touch the traits that still use integral_constant, so they never got updated.
>
>
>>
>> This patch unifies those usages into __bool_constant.
>
>
> Thanks, doing this for consistency seems reasonable, and safe to do now instead of waiting until after the GCC 13 release. I'll test and push the patch.
>
> Do you have a GCC copyright assignment on file with the FSF?
> If not, either you need to complete that paperwork, or add a DCO sign-off to all your patches:
> https://gcc.gnu.org/dco.html
>
>>
>>
>> libstdc++-v3/ChangeLog:
>>
>>         * include/std/type_traits: Use __bool_constant instead of
>>         integral_constant.
>> ---
>>  libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
>>  1 file changed, 16 insertions(+), 16 deletions(-)
>>
>> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
>> index 2bd607a8b8f..bc6982f9e64 100644
>> --- a/libstdc++-v3/include/std/type_traits
>> +++ b/libstdc++-v3/include/std/type_traits
>> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_enum
>>    template<typename _Tp>
>>      struct is_enum
>> -    : public integral_constant<bool, __is_enum(_Tp)>
>> +    : public __bool_constant<__is_enum(_Tp)>
>>      { };
>>
>>    /// is_union
>>    template<typename _Tp>
>>      struct is_union
>> -    : public integral_constant<bool, __is_union(_Tp)>
>> +    : public __bool_constant<__is_union(_Tp)>
>>      { };
>>
>>    /// is_class
>>    template<typename _Tp>
>>      struct is_class
>> -    : public integral_constant<bool, __is_class(_Tp)>
>> +    : public __bool_constant<__is_class(_Tp)>
>>      { };
>>
>>    /// is_function
>> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_trivial
>>    template<typename _Tp>
>>      struct is_trivial
>> -    : public integral_constant<bool, __is_trivial(_Tp)>
>> +    : public __bool_constant<__is_trivial(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_trivially_copyable
>>    template<typename _Tp>
>>      struct is_trivially_copyable
>> -    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
>> +    : public __bool_constant<__is_trivially_copyable(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_standard_layout
>>    template<typename _Tp>
>>      struct is_standard_layout
>> -    : public integral_constant<bool, __is_standard_layout(_Tp)>
>> +    : public __bool_constant<__is_standard_layout(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>      struct
>>      _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
>>      is_pod
>> -    : public integral_constant<bool, __is_pod(_Tp)>
>> +    : public __bool_constant<__is_pod(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>      struct
>>      _GLIBCXX17_DEPRECATED
>>      is_literal_type
>> -    : public integral_constant<bool, __is_literal_type(_Tp)>
>> +    : public __bool_constant<__is_literal_type(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_empty
>>    template<typename _Tp>
>>      struct is_empty
>> -    : public integral_constant<bool, __is_empty(_Tp)>
>> +    : public __bool_constant<__is_empty(_Tp)>
>>      { };
>>
>>    /// is_polymorphic
>>    template<typename _Tp>
>>      struct is_polymorphic
>> -    : public integral_constant<bool, __is_polymorphic(_Tp)>
>> +    : public __bool_constant<__is_polymorphic(_Tp)>
>>      { };
>>
>>  #if __cplusplus >= 201402L
>> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// @since C++14
>>    template<typename _Tp>
>>      struct is_final
>> -    : public integral_constant<bool, __is_final(_Tp)>
>> +    : public __bool_constant<__is_final(_Tp)>
>>      { };
>>  #endif
>>
>>    /// is_abstract
>>    template<typename _Tp>
>>      struct is_abstract
>> -    : public integral_constant<bool, __is_abstract(_Tp)>
>> +    : public __bool_constant<__is_abstract(_Tp)>
>>      { };
>>
>>    /// @cond undocumented
>> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>
>>    template<typename _Tp>
>>      struct __is_signed_helper<_Tp, true>
>> -    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
>> +    : public __bool_constant<_Tp(-1) < _Tp(0)>
>>      { };
>>    /// @endcond
>>
>> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// has_virtual_destructor
>>    template<typename _Tp>
>>      struct has_virtual_destructor
>> -    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
>> +    : public __bool_constant<__has_virtual_destructor(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    template<typename _Tp, typename _Up>
>>      struct is_same
>>  #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
>> -    : public integral_constant<bool, __is_same(_Tp, _Up)>
>> +    : public __bool_constant<__is_same(_Tp, _Up)>
>>  #else
>>      : public false_type
>>  #endif
>> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_base_of
>>    template<typename _Base, typename _Derived>
>>      struct is_base_of
>> -    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
>> +    : public __bool_constant<__is_base_of(_Base, _Derived)>
>>      { };
>>
>>  #if __has_builtin(__is_convertible)
>> --
>> 2.40.0
>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23 10:17   ` Ken Matsui
@ 2023-03-23 10:46     ` Ville Voutilainen
  2023-03-23 10:53       ` Ken Matsui
  0 siblings, 1 reply; 14+ messages in thread
From: Ville Voutilainen @ 2023-03-23 10:46 UTC (permalink / raw)
  To: Ken Matsui; +Cc: Jonathan Wakely, gcc-patches, libstdc++

On Thu, 23 Mar 2023 at 12:18, Ken Matsui via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Thank you so much for your review!
>
> This is my first time contributing to GCC, so I do not have a GCC
> copyright assignment. I googled those two ways, but I am still
> confused... Is it correct that the DCO sign-off has been getting more
> common recently? If so, I will put the sign-off into all my patches. I
> would prefer to choose the more common and lightweight way.

DCO sign-off is indeed more light-weight, and sure, it's becoming more common
since it's relatively new as an option.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23 10:46     ` Ville Voutilainen
@ 2023-03-23 10:53       ` Ken Matsui
  2023-03-23 10:56         ` Ville Voutilainen
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Matsui @ 2023-03-23 10:53 UTC (permalink / raw)
  To: Ville Voutilainen; +Cc: Jonathan Wakely, gcc-patches, libstdc++

On Thu, Mar 23, 2023 at 3:46 AM Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
>
> On Thu, 23 Mar 2023 at 12:18, Ken Matsui via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
> >
> > Thank you so much for your review!
> >
> > This is my first time contributing to GCC, so I do not have a GCC
> > copyright assignment. I googled those two ways, but I am still
> > confused... Is it correct that the DCO sign-off has been getting more
> > common recently? If so, I will put the sign-off into all my patches. I
> > would prefer to choose the more common and lightweight way.
>
> DCO sign-off is indeed more light-weight, and sure, it's becoming more common
> since it's relatively new as an option.

Thank you!

To add a DCO sign-off, do I need to bump up the subject line to [PATCH v2]?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23 10:53       ` Ken Matsui
@ 2023-03-23 10:56         ` Ville Voutilainen
  2023-03-23 11:00           ` Ken Matsui
  0 siblings, 1 reply; 14+ messages in thread
From: Ville Voutilainen @ 2023-03-23 10:56 UTC (permalink / raw)
  To: Ken Matsui; +Cc: Jonathan Wakely, gcc-patches, libstdc++

On Thu, 23 Mar 2023 at 12:53, Ken Matsui <kmatsui@cs.washington.edu> wrote:

> > DCO sign-off is indeed more light-weight, and sure, it's becoming more common
> > since it's relatively new as an option.
>
> Thank you!
>
> To add a DCO sign-off, do I need to bump up the subject line to [PATCH v2]?

No. The format of the subject for patch submission emails is not that strict. :)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23 10:56         ` Ville Voutilainen
@ 2023-03-23 11:00           ` Ken Matsui
  2023-03-23 11:06             ` Ken Matsui
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Matsui @ 2023-03-23 11:00 UTC (permalink / raw)
  To: Ville Voutilainen; +Cc: Jonathan Wakely, gcc-patches, libstdc++

On Thu, Mar 23, 2023 at 3:56 AM Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
>
> On Thu, 23 Mar 2023 at 12:53, Ken Matsui <kmatsui@cs.washington.edu> wrote:
>
> > > DCO sign-off is indeed more light-weight, and sure, it's becoming more common
> > > since it's relatively new as an option.
> >
> > Thank you!
> >
> > To add a DCO sign-off, do I need to bump up the subject line to [PATCH v2]?
>
> No. The format of the subject for patch submission emails is not that strict. :)

I see. I will update this patch. Thank you so much for your support!

Sincerely,
Ken Matsui

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23 11:00           ` Ken Matsui
@ 2023-03-23 11:06             ` Ken Matsui
  2023-04-08  1:02               ` PING: " Ken Matsui
  2023-04-08  7:52               ` Jonathan Wakely
  0 siblings, 2 replies; 14+ messages in thread
From: Ken Matsui @ 2023-03-23 11:06 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++, Jonathan Wakely, ville.voutilainen, Ken Matsui

In the type_traits header, both integral_constant<bool> and __bool_constant
are used. This patch unifies those usages into __bool_constant.

libstdc++-v3/ChangeLog:

	* include/std/type_traits: Use __bool_constant instead of
	integral_constant.

Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
---
 libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 2bd607a8b8f..bc6982f9e64 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_enum
   template<typename _Tp>
     struct is_enum
-    : public integral_constant<bool, __is_enum(_Tp)>
+    : public __bool_constant<__is_enum(_Tp)>
     { };
 
   /// is_union
   template<typename _Tp>
     struct is_union
-    : public integral_constant<bool, __is_union(_Tp)>
+    : public __bool_constant<__is_union(_Tp)>
     { };
 
   /// is_class
   template<typename _Tp>
     struct is_class
-    : public integral_constant<bool, __is_class(_Tp)>
+    : public __bool_constant<__is_class(_Tp)>
     { };
 
   /// is_function
@@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_trivial
   template<typename _Tp>
     struct is_trivial
-    : public integral_constant<bool, __is_trivial(_Tp)>
+    : public __bool_constant<__is_trivial(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_trivially_copyable
   template<typename _Tp>
     struct is_trivially_copyable
-    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
+    : public __bool_constant<__is_trivially_copyable(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_standard_layout
   template<typename _Tp>
     struct is_standard_layout
-    : public integral_constant<bool, __is_standard_layout(_Tp)>
+    : public __bool_constant<__is_standard_layout(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct
     _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
     is_pod
-    : public integral_constant<bool, __is_pod(_Tp)>
+    : public __bool_constant<__is_pod(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct
     _GLIBCXX17_DEPRECATED
     is_literal_type
-    : public integral_constant<bool, __is_literal_type(_Tp)>
+    : public __bool_constant<__is_literal_type(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_empty
   template<typename _Tp>
     struct is_empty
-    : public integral_constant<bool, __is_empty(_Tp)>
+    : public __bool_constant<__is_empty(_Tp)>
     { };
 
   /// is_polymorphic
   template<typename _Tp>
     struct is_polymorphic
-    : public integral_constant<bool, __is_polymorphic(_Tp)>
+    : public __bool_constant<__is_polymorphic(_Tp)>
     { };
 
 #if __cplusplus >= 201402L
@@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// @since C++14
   template<typename _Tp>
     struct is_final
-    : public integral_constant<bool, __is_final(_Tp)>
+    : public __bool_constant<__is_final(_Tp)>
     { };
 #endif
 
   /// is_abstract
   template<typename _Tp>
     struct is_abstract
-    : public integral_constant<bool, __is_abstract(_Tp)>
+    : public __bool_constant<__is_abstract(_Tp)>
     { };
 
   /// @cond undocumented
@@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Tp>
     struct __is_signed_helper<_Tp, true>
-    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
+    : public __bool_constant<_Tp(-1) < _Tp(0)>
     { };
   /// @endcond
 
@@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// has_virtual_destructor
   template<typename _Tp>
     struct has_virtual_destructor
-    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
+    : public __bool_constant<__has_virtual_destructor(_Tp)>
     {
       static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
 	"template argument must be a complete class or an unbounded array");
@@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp, typename _Up>
     struct is_same
 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
-    : public integral_constant<bool, __is_same(_Tp, _Up)>
+    : public __bool_constant<__is_same(_Tp, _Up)>
 #else
     : public false_type
 #endif
@@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /// is_base_of
   template<typename _Base, typename _Derived>
     struct is_base_of
-    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
+    : public __bool_constant<__is_base_of(_Base, _Derived)>
     { };
 
 #if __has_builtin(__is_convertible)
-- 
2.40.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* PING: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23 11:06             ` Ken Matsui
@ 2023-04-08  1:02               ` Ken Matsui
  2023-04-08  7:52               ` Jonathan Wakely
  1 sibling, 0 replies; 14+ messages in thread
From: Ken Matsui @ 2023-04-08  1:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++, Jonathan Wakely, Ville Voutilainen

Ping for this patch.

On Thu, Mar 23, 2023 at 4:06 AM Ken Matsui <kmatsui@cs.washington.edu> wrote:
>
> In the type_traits header, both integral_constant<bool> and __bool_constant
> are used. This patch unifies those usages into __bool_constant.
>
> libstdc++-v3/ChangeLog:
>
>         * include/std/type_traits: Use __bool_constant instead of
>         integral_constant.
>
> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
> ---
>  libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
> index 2bd607a8b8f..bc6982f9e64 100644
> --- a/libstdc++-v3/include/std/type_traits
> +++ b/libstdc++-v3/include/std/type_traits
> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_enum
>    template<typename _Tp>
>      struct is_enum
> -    : public integral_constant<bool, __is_enum(_Tp)>
> +    : public __bool_constant<__is_enum(_Tp)>
>      { };
>
>    /// is_union
>    template<typename _Tp>
>      struct is_union
> -    : public integral_constant<bool, __is_union(_Tp)>
> +    : public __bool_constant<__is_union(_Tp)>
>      { };
>
>    /// is_class
>    template<typename _Tp>
>      struct is_class
> -    : public integral_constant<bool, __is_class(_Tp)>
> +    : public __bool_constant<__is_class(_Tp)>
>      { };
>
>    /// is_function
> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_trivial
>    template<typename _Tp>
>      struct is_trivial
> -    : public integral_constant<bool, __is_trivial(_Tp)>
> +    : public __bool_constant<__is_trivial(_Tp)>
>      {
>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded array");
> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_trivially_copyable
>    template<typename _Tp>
>      struct is_trivially_copyable
> -    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
> +    : public __bool_constant<__is_trivially_copyable(_Tp)>
>      {
>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded array");
> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_standard_layout
>    template<typename _Tp>
>      struct is_standard_layout
> -    : public integral_constant<bool, __is_standard_layout(_Tp)>
> +    : public __bool_constant<__is_standard_layout(_Tp)>
>      {
>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded array");
> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>      struct
>      _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
>      is_pod
> -    : public integral_constant<bool, __is_pod(_Tp)>
> +    : public __bool_constant<__is_pod(_Tp)>
>      {
>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded array");
> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>      struct
>      _GLIBCXX17_DEPRECATED
>      is_literal_type
> -    : public integral_constant<bool, __is_literal_type(_Tp)>
> +    : public __bool_constant<__is_literal_type(_Tp)>
>      {
>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded array");
> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_empty
>    template<typename _Tp>
>      struct is_empty
> -    : public integral_constant<bool, __is_empty(_Tp)>
> +    : public __bool_constant<__is_empty(_Tp)>
>      { };
>
>    /// is_polymorphic
>    template<typename _Tp>
>      struct is_polymorphic
> -    : public integral_constant<bool, __is_polymorphic(_Tp)>
> +    : public __bool_constant<__is_polymorphic(_Tp)>
>      { };
>
>  #if __cplusplus >= 201402L
> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// @since C++14
>    template<typename _Tp>
>      struct is_final
> -    : public integral_constant<bool, __is_final(_Tp)>
> +    : public __bool_constant<__is_final(_Tp)>
>      { };
>  #endif
>
>    /// is_abstract
>    template<typename _Tp>
>      struct is_abstract
> -    : public integral_constant<bool, __is_abstract(_Tp)>
> +    : public __bool_constant<__is_abstract(_Tp)>
>      { };
>
>    /// @cond undocumented
> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>
>    template<typename _Tp>
>      struct __is_signed_helper<_Tp, true>
> -    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
> +    : public __bool_constant<_Tp(-1) < _Tp(0)>
>      { };
>    /// @endcond
>
> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// has_virtual_destructor
>    template<typename _Tp>
>      struct has_virtual_destructor
> -    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
> +    : public __bool_constant<__has_virtual_destructor(_Tp)>
>      {
>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded array");
> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    template<typename _Tp, typename _Up>
>      struct is_same
>  #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
> -    : public integral_constant<bool, __is_same(_Tp, _Up)>
> +    : public __bool_constant<__is_same(_Tp, _Up)>
>  #else
>      : public false_type
>  #endif
> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_base_of
>    template<typename _Base, typename _Derived>
>      struct is_base_of
> -    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
> +    : public __bool_constant<__is_base_of(_Base, _Derived)>
>      { };
>
>  #if __has_builtin(__is_convertible)
> --
> 2.40.0
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-03-23 11:06             ` Ken Matsui
  2023-04-08  1:02               ` PING: " Ken Matsui
@ 2023-04-08  7:52               ` Jonathan Wakely
  2023-04-08 21:08                 ` Ken Matsui
  1 sibling, 1 reply; 14+ messages in thread
From: Jonathan Wakely @ 2023-04-08  7:52 UTC (permalink / raw)
  To: Ken Matsui; +Cc: gcc-patches, libstdc++, Jonathan Wakely, Ville Voutilainen

[-- Attachment #1: Type: text/plain, Size: 6048 bytes --]

This looks good, thanks, but we're too close to the gcc 13 release now, and
this isn't fixing any bugs. I'll push it after the release.


On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org>
wrote:

> In the type_traits header, both integral_constant<bool> and __bool_constant
> are used. This patch unifies those usages into __bool_constant.
>
> libstdc++-v3/ChangeLog:
>
>         * include/std/type_traits: Use __bool_constant instead of
>         integral_constant.
>
> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
> ---
>  libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
>  1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/libstdc++-v3/include/std/type_traits
> b/libstdc++-v3/include/std/type_traits
> index 2bd607a8b8f..bc6982f9e64 100644
> --- a/libstdc++-v3/include/std/type_traits
> +++ b/libstdc++-v3/include/std/type_traits
> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_enum
>    template<typename _Tp>
>      struct is_enum
> -    : public integral_constant<bool, __is_enum(_Tp)>
> +    : public __bool_constant<__is_enum(_Tp)>
>      { };
>
>    /// is_union
>    template<typename _Tp>
>      struct is_union
> -    : public integral_constant<bool, __is_union(_Tp)>
> +    : public __bool_constant<__is_union(_Tp)>
>      { };
>
>    /// is_class
>    template<typename _Tp>
>      struct is_class
> -    : public integral_constant<bool, __is_class(_Tp)>
> +    : public __bool_constant<__is_class(_Tp)>
>      { };
>
>    /// is_function
> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_trivial
>    template<typename _Tp>
>      struct is_trivial
> -    : public integral_constant<bool, __is_trivial(_Tp)>
> +    : public __bool_constant<__is_trivial(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_trivially_copyable
>    template<typename _Tp>
>      struct is_trivially_copyable
> -    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
> +    : public __bool_constant<__is_trivially_copyable(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_standard_layout
>    template<typename _Tp>
>      struct is_standard_layout
> -    : public integral_constant<bool, __is_standard_layout(_Tp)>
> +    : public __bool_constant<__is_standard_layout(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>      struct
>      _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
>      is_pod
> -    : public integral_constant<bool, __is_pod(_Tp)>
> +    : public __bool_constant<__is_pod(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>      struct
>      _GLIBCXX17_DEPRECATED
>      is_literal_type
> -    : public integral_constant<bool, __is_literal_type(_Tp)>
> +    : public __bool_constant<__is_literal_type(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_empty
>    template<typename _Tp>
>      struct is_empty
> -    : public integral_constant<bool, __is_empty(_Tp)>
> +    : public __bool_constant<__is_empty(_Tp)>
>      { };
>
>    /// is_polymorphic
>    template<typename _Tp>
>      struct is_polymorphic
> -    : public integral_constant<bool, __is_polymorphic(_Tp)>
> +    : public __bool_constant<__is_polymorphic(_Tp)>
>      { };
>
>  #if __cplusplus >= 201402L
> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// @since C++14
>    template<typename _Tp>
>      struct is_final
> -    : public integral_constant<bool, __is_final(_Tp)>
> +    : public __bool_constant<__is_final(_Tp)>
>      { };
>  #endif
>
>    /// is_abstract
>    template<typename _Tp>
>      struct is_abstract
> -    : public integral_constant<bool, __is_abstract(_Tp)>
> +    : public __bool_constant<__is_abstract(_Tp)>
>      { };
>
>    /// @cond undocumented
> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>
>    template<typename _Tp>
>      struct __is_signed_helper<_Tp, true>
> -    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
> +    : public __bool_constant<_Tp(-1) < _Tp(0)>
>      { };
>    /// @endcond
>
> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// has_virtual_destructor
>    template<typename _Tp>
>      struct has_virtual_destructor
> -    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
> +    : public __bool_constant<__has_virtual_destructor(_Tp)>
>      {
>
>  static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>         "template argument must be a complete class or an unbounded
> array");
> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    template<typename _Tp, typename _Up>
>      struct is_same
>  #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
> -    : public integral_constant<bool, __is_same(_Tp, _Up)>
> +    : public __bool_constant<__is_same(_Tp, _Up)>
>  #else
>      : public false_type
>  #endif
> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    /// is_base_of
>    template<typename _Base, typename _Derived>
>      struct is_base_of
> -    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
> +    : public __bool_constant<__is_base_of(_Base, _Derived)>
>      { };
>
>  #if __has_builtin(__is_convertible)
> --
> 2.40.0
>
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-04-08  7:52               ` Jonathan Wakely
@ 2023-04-08 21:08                 ` Ken Matsui
  2023-05-13  3:22                   ` Ken Matsui
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Matsui @ 2023-04-08 21:08 UTC (permalink / raw)
  To: Jonathan Wakely
  Cc: gcc-patches, libstdc++, Jonathan Wakely, Ville Voutilainen

I see. Thank you!

On Sat, Apr 8, 2023 at 12:52 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>
> This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release.
>
>
> On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote:
>>
>> In the type_traits header, both integral_constant<bool> and __bool_constant
>> are used. This patch unifies those usages into __bool_constant.
>>
>> libstdc++-v3/ChangeLog:
>>
>>         * include/std/type_traits: Use __bool_constant instead of
>>         integral_constant.
>>
>> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
>> ---
>>  libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
>>  1 file changed, 16 insertions(+), 16 deletions(-)
>>
>> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
>> index 2bd607a8b8f..bc6982f9e64 100644
>> --- a/libstdc++-v3/include/std/type_traits
>> +++ b/libstdc++-v3/include/std/type_traits
>> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_enum
>>    template<typename _Tp>
>>      struct is_enum
>> -    : public integral_constant<bool, __is_enum(_Tp)>
>> +    : public __bool_constant<__is_enum(_Tp)>
>>      { };
>>
>>    /// is_union
>>    template<typename _Tp>
>>      struct is_union
>> -    : public integral_constant<bool, __is_union(_Tp)>
>> +    : public __bool_constant<__is_union(_Tp)>
>>      { };
>>
>>    /// is_class
>>    template<typename _Tp>
>>      struct is_class
>> -    : public integral_constant<bool, __is_class(_Tp)>
>> +    : public __bool_constant<__is_class(_Tp)>
>>      { };
>>
>>    /// is_function
>> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_trivial
>>    template<typename _Tp>
>>      struct is_trivial
>> -    : public integral_constant<bool, __is_trivial(_Tp)>
>> +    : public __bool_constant<__is_trivial(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_trivially_copyable
>>    template<typename _Tp>
>>      struct is_trivially_copyable
>> -    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
>> +    : public __bool_constant<__is_trivially_copyable(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_standard_layout
>>    template<typename _Tp>
>>      struct is_standard_layout
>> -    : public integral_constant<bool, __is_standard_layout(_Tp)>
>> +    : public __bool_constant<__is_standard_layout(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>      struct
>>      _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
>>      is_pod
>> -    : public integral_constant<bool, __is_pod(_Tp)>
>> +    : public __bool_constant<__is_pod(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>      struct
>>      _GLIBCXX17_DEPRECATED
>>      is_literal_type
>> -    : public integral_constant<bool, __is_literal_type(_Tp)>
>> +    : public __bool_constant<__is_literal_type(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_empty
>>    template<typename _Tp>
>>      struct is_empty
>> -    : public integral_constant<bool, __is_empty(_Tp)>
>> +    : public __bool_constant<__is_empty(_Tp)>
>>      { };
>>
>>    /// is_polymorphic
>>    template<typename _Tp>
>>      struct is_polymorphic
>> -    : public integral_constant<bool, __is_polymorphic(_Tp)>
>> +    : public __bool_constant<__is_polymorphic(_Tp)>
>>      { };
>>
>>  #if __cplusplus >= 201402L
>> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// @since C++14
>>    template<typename _Tp>
>>      struct is_final
>> -    : public integral_constant<bool, __is_final(_Tp)>
>> +    : public __bool_constant<__is_final(_Tp)>
>>      { };
>>  #endif
>>
>>    /// is_abstract
>>    template<typename _Tp>
>>      struct is_abstract
>> -    : public integral_constant<bool, __is_abstract(_Tp)>
>> +    : public __bool_constant<__is_abstract(_Tp)>
>>      { };
>>
>>    /// @cond undocumented
>> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>
>>    template<typename _Tp>
>>      struct __is_signed_helper<_Tp, true>
>> -    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
>> +    : public __bool_constant<_Tp(-1) < _Tp(0)>
>>      { };
>>    /// @endcond
>>
>> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// has_virtual_destructor
>>    template<typename _Tp>
>>      struct has_virtual_destructor
>> -    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
>> +    : public __bool_constant<__has_virtual_destructor(_Tp)>
>>      {
>>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
>>         "template argument must be a complete class or an unbounded array");
>> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    template<typename _Tp, typename _Up>
>>      struct is_same
>>  #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
>> -    : public integral_constant<bool, __is_same(_Tp, _Up)>
>> +    : public __bool_constant<__is_same(_Tp, _Up)>
>>  #else
>>      : public false_type
>>  #endif
>> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>>    /// is_base_of
>>    template<typename _Base, typename _Derived>
>>      struct is_base_of
>> -    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
>> +    : public __bool_constant<__is_base_of(_Base, _Derived)>
>>      { };
>>
>>  #if __has_builtin(__is_convertible)
>> --
>> 2.40.0
>>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-04-08 21:08                 ` Ken Matsui
@ 2023-05-13  3:22                   ` Ken Matsui
  2023-05-17 15:53                     ` Patrick Palka
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Matsui @ 2023-05-13  3:22 UTC (permalink / raw)
  To: Jonathan Wakely
  Cc: gcc-patches, libstdc++, Jonathan Wakely, Ville Voutilainen

It appears that GCC 13 has been released, but I am wondering if there
are any issues preventing this patch from being merged yet. Can you
provide any information on this?

On Sat, Apr 8, 2023 at 2:08 PM Ken Matsui <kmatsui@cs.washington.edu> wrote:
>
> I see. Thank you!
>
> On Sat, Apr 8, 2023 at 12:52 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> >
> > This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release.
> >
> >
> > On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote:
> >>
> >> In the type_traits header, both integral_constant<bool> and __bool_constant
> >> are used. This patch unifies those usages into __bool_constant.
> >>
> >> libstdc++-v3/ChangeLog:
> >>
> >>         * include/std/type_traits: Use __bool_constant instead of
> >>         integral_constant.
> >>
> >> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
> >> ---
> >>  libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
> >>  1 file changed, 16 insertions(+), 16 deletions(-)
> >>
> >> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
> >> index 2bd607a8b8f..bc6982f9e64 100644
> >> --- a/libstdc++-v3/include/std/type_traits
> >> +++ b/libstdc++-v3/include/std/type_traits
> >> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    /// is_enum
> >>    template<typename _Tp>
> >>      struct is_enum
> >> -    : public integral_constant<bool, __is_enum(_Tp)>
> >> +    : public __bool_constant<__is_enum(_Tp)>
> >>      { };
> >>
> >>    /// is_union
> >>    template<typename _Tp>
> >>      struct is_union
> >> -    : public integral_constant<bool, __is_union(_Tp)>
> >> +    : public __bool_constant<__is_union(_Tp)>
> >>      { };
> >>
> >>    /// is_class
> >>    template<typename _Tp>
> >>      struct is_class
> >> -    : public integral_constant<bool, __is_class(_Tp)>
> >> +    : public __bool_constant<__is_class(_Tp)>
> >>      { };
> >>
> >>    /// is_function
> >> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    /// is_trivial
> >>    template<typename _Tp>
> >>      struct is_trivial
> >> -    : public integral_constant<bool, __is_trivial(_Tp)>
> >> +    : public __bool_constant<__is_trivial(_Tp)>
> >>      {
> >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> >>         "template argument must be a complete class or an unbounded array");
> >> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    /// is_trivially_copyable
> >>    template<typename _Tp>
> >>      struct is_trivially_copyable
> >> -    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
> >> +    : public __bool_constant<__is_trivially_copyable(_Tp)>
> >>      {
> >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> >>         "template argument must be a complete class or an unbounded array");
> >> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    /// is_standard_layout
> >>    template<typename _Tp>
> >>      struct is_standard_layout
> >> -    : public integral_constant<bool, __is_standard_layout(_Tp)>
> >> +    : public __bool_constant<__is_standard_layout(_Tp)>
> >>      {
> >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> >>         "template argument must be a complete class or an unbounded array");
> >> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>      struct
> >>      _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
> >>      is_pod
> >> -    : public integral_constant<bool, __is_pod(_Tp)>
> >> +    : public __bool_constant<__is_pod(_Tp)>
> >>      {
> >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> >>         "template argument must be a complete class or an unbounded array");
> >> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>      struct
> >>      _GLIBCXX17_DEPRECATED
> >>      is_literal_type
> >> -    : public integral_constant<bool, __is_literal_type(_Tp)>
> >> +    : public __bool_constant<__is_literal_type(_Tp)>
> >>      {
> >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> >>         "template argument must be a complete class or an unbounded array");
> >> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    /// is_empty
> >>    template<typename _Tp>
> >>      struct is_empty
> >> -    : public integral_constant<bool, __is_empty(_Tp)>
> >> +    : public __bool_constant<__is_empty(_Tp)>
> >>      { };
> >>
> >>    /// is_polymorphic
> >>    template<typename _Tp>
> >>      struct is_polymorphic
> >> -    : public integral_constant<bool, __is_polymorphic(_Tp)>
> >> +    : public __bool_constant<__is_polymorphic(_Tp)>
> >>      { };
> >>
> >>  #if __cplusplus >= 201402L
> >> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    /// @since C++14
> >>    template<typename _Tp>
> >>      struct is_final
> >> -    : public integral_constant<bool, __is_final(_Tp)>
> >> +    : public __bool_constant<__is_final(_Tp)>
> >>      { };
> >>  #endif
> >>
> >>    /// is_abstract
> >>    template<typename _Tp>
> >>      struct is_abstract
> >> -    : public integral_constant<bool, __is_abstract(_Tp)>
> >> +    : public __bool_constant<__is_abstract(_Tp)>
> >>      { };
> >>
> >>    /// @cond undocumented
> >> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>
> >>    template<typename _Tp>
> >>      struct __is_signed_helper<_Tp, true>
> >> -    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
> >> +    : public __bool_constant<_Tp(-1) < _Tp(0)>
> >>      { };
> >>    /// @endcond
> >>
> >> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    /// has_virtual_destructor
> >>    template<typename _Tp>
> >>      struct has_virtual_destructor
> >> -    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
> >> +    : public __bool_constant<__has_virtual_destructor(_Tp)>
> >>      {
> >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> >>         "template argument must be a complete class or an unbounded array");
> >> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    template<typename _Tp, typename _Up>
> >>      struct is_same
> >>  #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
> >> -    : public integral_constant<bool, __is_same(_Tp, _Up)>
> >> +    : public __bool_constant<__is_same(_Tp, _Up)>
> >>  #else
> >>      : public false_type
> >>  #endif
> >> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> >>    /// is_base_of
> >>    template<typename _Base, typename _Derived>
> >>      struct is_base_of
> >> -    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
> >> +    : public __bool_constant<__is_base_of(_Base, _Derived)>
> >>      { };
> >>
> >>  #if __has_builtin(__is_convertible)
> >> --
> >> 2.40.0
> >>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-05-13  3:22                   ` Ken Matsui
@ 2023-05-17 15:53                     ` Patrick Palka
  2023-05-17 21:14                       ` Ken Matsui
  0 siblings, 1 reply; 14+ messages in thread
From: Patrick Palka @ 2023-05-17 15:53 UTC (permalink / raw)
  To: Ken Matsui
  Cc: Jonathan Wakely, gcc-patches, libstdc++,
	Jonathan Wakely, Ville Voutilainen

[-- Attachment #1: Type: text/plain, Size: 7437 bytes --]

On Fri, 12 May 2023, Ken Matsui via Libstdc++ wrote:

> It appears that GCC 13 has been released, but I am wondering if there
> are any issues preventing this patch from being merged yet. Can you
> provide any information on this?

Thanks for the reminder, I pushed this to trunk just now
(r14-940-g637edefc5863cf). Congrats on your first libstdc++ commit!

> 
> On Sat, Apr 8, 2023 at 2:08 PM Ken Matsui <kmatsui@cs.washington.edu> wrote:
> >
> > I see. Thank you!
> >
> > On Sat, Apr 8, 2023 at 12:52 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> > >
> > > This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release.
> > >
> > >
> > > On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote:
> > >>
> > >> In the type_traits header, both integral_constant<bool> and __bool_constant
> > >> are used. This patch unifies those usages into __bool_constant.
> > >>
> > >> libstdc++-v3/ChangeLog:
> > >>
> > >>         * include/std/type_traits: Use __bool_constant instead of
> > >>         integral_constant.
> > >>
> > >> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
> > >> ---
> > >>  libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
> > >>  1 file changed, 16 insertions(+), 16 deletions(-)
> > >>
> > >> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
> > >> index 2bd607a8b8f..bc6982f9e64 100644
> > >> --- a/libstdc++-v3/include/std/type_traits
> > >> +++ b/libstdc++-v3/include/std/type_traits
> > >> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    /// is_enum
> > >>    template<typename _Tp>
> > >>      struct is_enum
> > >> -    : public integral_constant<bool, __is_enum(_Tp)>
> > >> +    : public __bool_constant<__is_enum(_Tp)>
> > >>      { };
> > >>
> > >>    /// is_union
> > >>    template<typename _Tp>
> > >>      struct is_union
> > >> -    : public integral_constant<bool, __is_union(_Tp)>
> > >> +    : public __bool_constant<__is_union(_Tp)>
> > >>      { };
> > >>
> > >>    /// is_class
> > >>    template<typename _Tp>
> > >>      struct is_class
> > >> -    : public integral_constant<bool, __is_class(_Tp)>
> > >> +    : public __bool_constant<__is_class(_Tp)>
> > >>      { };
> > >>
> > >>    /// is_function
> > >> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    /// is_trivial
> > >>    template<typename _Tp>
> > >>      struct is_trivial
> > >> -    : public integral_constant<bool, __is_trivial(_Tp)>
> > >> +    : public __bool_constant<__is_trivial(_Tp)>
> > >>      {
> > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > >>         "template argument must be a complete class or an unbounded array");
> > >> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    /// is_trivially_copyable
> > >>    template<typename _Tp>
> > >>      struct is_trivially_copyable
> > >> -    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
> > >> +    : public __bool_constant<__is_trivially_copyable(_Tp)>
> > >>      {
> > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > >>         "template argument must be a complete class or an unbounded array");
> > >> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    /// is_standard_layout
> > >>    template<typename _Tp>
> > >>      struct is_standard_layout
> > >> -    : public integral_constant<bool, __is_standard_layout(_Tp)>
> > >> +    : public __bool_constant<__is_standard_layout(_Tp)>
> > >>      {
> > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > >>         "template argument must be a complete class or an unbounded array");
> > >> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>      struct
> > >>      _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
> > >>      is_pod
> > >> -    : public integral_constant<bool, __is_pod(_Tp)>
> > >> +    : public __bool_constant<__is_pod(_Tp)>
> > >>      {
> > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > >>         "template argument must be a complete class or an unbounded array");
> > >> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>      struct
> > >>      _GLIBCXX17_DEPRECATED
> > >>      is_literal_type
> > >> -    : public integral_constant<bool, __is_literal_type(_Tp)>
> > >> +    : public __bool_constant<__is_literal_type(_Tp)>
> > >>      {
> > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > >>         "template argument must be a complete class or an unbounded array");
> > >> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    /// is_empty
> > >>    template<typename _Tp>
> > >>      struct is_empty
> > >> -    : public integral_constant<bool, __is_empty(_Tp)>
> > >> +    : public __bool_constant<__is_empty(_Tp)>
> > >>      { };
> > >>
> > >>    /// is_polymorphic
> > >>    template<typename _Tp>
> > >>      struct is_polymorphic
> > >> -    : public integral_constant<bool, __is_polymorphic(_Tp)>
> > >> +    : public __bool_constant<__is_polymorphic(_Tp)>
> > >>      { };
> > >>
> > >>  #if __cplusplus >= 201402L
> > >> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    /// @since C++14
> > >>    template<typename _Tp>
> > >>      struct is_final
> > >> -    : public integral_constant<bool, __is_final(_Tp)>
> > >> +    : public __bool_constant<__is_final(_Tp)>
> > >>      { };
> > >>  #endif
> > >>
> > >>    /// is_abstract
> > >>    template<typename _Tp>
> > >>      struct is_abstract
> > >> -    : public integral_constant<bool, __is_abstract(_Tp)>
> > >> +    : public __bool_constant<__is_abstract(_Tp)>
> > >>      { };
> > >>
> > >>    /// @cond undocumented
> > >> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>
> > >>    template<typename _Tp>
> > >>      struct __is_signed_helper<_Tp, true>
> > >> -    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
> > >> +    : public __bool_constant<_Tp(-1) < _Tp(0)>
> > >>      { };
> > >>    /// @endcond
> > >>
> > >> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    /// has_virtual_destructor
> > >>    template<typename _Tp>
> > >>      struct has_virtual_destructor
> > >> -    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
> > >> +    : public __bool_constant<__has_virtual_destructor(_Tp)>
> > >>      {
> > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > >>         "template argument must be a complete class or an unbounded array");
> > >> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    template<typename _Tp, typename _Up>
> > >>      struct is_same
> > >>  #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
> > >> -    : public integral_constant<bool, __is_same(_Tp, _Up)>
> > >> +    : public __bool_constant<__is_same(_Tp, _Up)>
> > >>  #else
> > >>      : public false_type
> > >>  #endif
> > >> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > >>    /// is_base_of
> > >>    template<typename _Base, typename _Derived>
> > >>      struct is_base_of
> > >> -    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
> > >> +    : public __bool_constant<__is_base_of(_Base, _Derived)>
> > >>      { };
> > >>
> > >>  #if __has_builtin(__is_convertible)
> > >> --
> > >> 2.40.0
> > >>
> 
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] libstdc++: use __bool_constant instead of integral_constant
  2023-05-17 15:53                     ` Patrick Palka
@ 2023-05-17 21:14                       ` Ken Matsui
  0 siblings, 0 replies; 14+ messages in thread
From: Ken Matsui @ 2023-05-17 21:14 UTC (permalink / raw)
  To: Patrick Palka
  Cc: Jonathan Wakely, gcc-patches, libstdc++,
	Jonathan Wakely, Ville Voutilainen

Thank you!

On Wed, May 17, 2023 at 8:53 AM Patrick Palka <ppalka@redhat.com> wrote:
>
> On Fri, 12 May 2023, Ken Matsui via Libstdc++ wrote:
>
> > It appears that GCC 13 has been released, but I am wondering if there
> > are any issues preventing this patch from being merged yet. Can you
> > provide any information on this?
>
> Thanks for the reminder, I pushed this to trunk just now
> (r14-940-g637edefc5863cf). Congrats on your first libstdc++ commit!
>
> >
> > On Sat, Apr 8, 2023 at 2:08 PM Ken Matsui <kmatsui@cs.washington.edu> wrote:
> > >
> > > I see. Thank you!
> > >
> > > On Sat, Apr 8, 2023 at 12:52 AM Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> > > >
> > > > This looks good, thanks, but we're too close to the gcc 13 release now, and this isn't fixing any bugs. I'll push it after the release.
> > > >
> > > >
> > > > On Thu, 23 Mar 2023, 11:07 Ken Matsui via Libstdc++, <libstdc++@gcc.gnu.org> wrote:
> > > >>
> > > >> In the type_traits header, both integral_constant<bool> and __bool_constant
> > > >> are used. This patch unifies those usages into __bool_constant.
> > > >>
> > > >> libstdc++-v3/ChangeLog:
> > > >>
> > > >>         * include/std/type_traits: Use __bool_constant instead of
> > > >>         integral_constant.
> > > >>
> > > >> Signed-off-by: Ken Matsui <kmatsui@cs.washington.edu>
> > > >> ---
> > > >>  libstdc++-v3/include/std/type_traits | 32 ++++++++++++++--------------
> > > >>  1 file changed, 16 insertions(+), 16 deletions(-)
> > > >>
> > > >> diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
> > > >> index 2bd607a8b8f..bc6982f9e64 100644
> > > >> --- a/libstdc++-v3/include/std/type_traits
> > > >> +++ b/libstdc++-v3/include/std/type_traits
> > > >> @@ -578,19 +578,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    /// is_enum
> > > >>    template<typename _Tp>
> > > >>      struct is_enum
> > > >> -    : public integral_constant<bool, __is_enum(_Tp)>
> > > >> +    : public __bool_constant<__is_enum(_Tp)>
> > > >>      { };
> > > >>
> > > >>    /// is_union
> > > >>    template<typename _Tp>
> > > >>      struct is_union
> > > >> -    : public integral_constant<bool, __is_union(_Tp)>
> > > >> +    : public __bool_constant<__is_union(_Tp)>
> > > >>      { };
> > > >>
> > > >>    /// is_class
> > > >>    template<typename _Tp>
> > > >>      struct is_class
> > > >> -    : public integral_constant<bool, __is_class(_Tp)>
> > > >> +    : public __bool_constant<__is_class(_Tp)>
> > > >>      { };
> > > >>
> > > >>    /// is_function
> > > >> @@ -784,7 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    /// is_trivial
> > > >>    template<typename _Tp>
> > > >>      struct is_trivial
> > > >> -    : public integral_constant<bool, __is_trivial(_Tp)>
> > > >> +    : public __bool_constant<__is_trivial(_Tp)>
> > > >>      {
> > > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > > >>         "template argument must be a complete class or an unbounded array");
> > > >> @@ -793,7 +793,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    /// is_trivially_copyable
> > > >>    template<typename _Tp>
> > > >>      struct is_trivially_copyable
> > > >> -    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
> > > >> +    : public __bool_constant<__is_trivially_copyable(_Tp)>
> > > >>      {
> > > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > > >>         "template argument must be a complete class or an unbounded array");
> > > >> @@ -802,7 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    /// is_standard_layout
> > > >>    template<typename _Tp>
> > > >>      struct is_standard_layout
> > > >> -    : public integral_constant<bool, __is_standard_layout(_Tp)>
> > > >> +    : public __bool_constant<__is_standard_layout(_Tp)>
> > > >>      {
> > > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > > >>         "template argument must be a complete class or an unbounded array");
> > > >> @@ -817,7 +817,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>      struct
> > > >>      _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial")
> > > >>      is_pod
> > > >> -    : public integral_constant<bool, __is_pod(_Tp)>
> > > >> +    : public __bool_constant<__is_pod(_Tp)>
> > > >>      {
> > > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > > >>         "template argument must be a complete class or an unbounded array");
> > > >> @@ -831,7 +831,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>      struct
> > > >>      _GLIBCXX17_DEPRECATED
> > > >>      is_literal_type
> > > >> -    : public integral_constant<bool, __is_literal_type(_Tp)>
> > > >> +    : public __bool_constant<__is_literal_type(_Tp)>
> > > >>      {
> > > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > > >>         "template argument must be a complete class or an unbounded array");
> > > >> @@ -840,13 +840,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    /// is_empty
> > > >>    template<typename _Tp>
> > > >>      struct is_empty
> > > >> -    : public integral_constant<bool, __is_empty(_Tp)>
> > > >> +    : public __bool_constant<__is_empty(_Tp)>
> > > >>      { };
> > > >>
> > > >>    /// is_polymorphic
> > > >>    template<typename _Tp>
> > > >>      struct is_polymorphic
> > > >> -    : public integral_constant<bool, __is_polymorphic(_Tp)>
> > > >> +    : public __bool_constant<__is_polymorphic(_Tp)>
> > > >>      { };
> > > >>
> > > >>  #if __cplusplus >= 201402L
> > > >> @@ -855,14 +855,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    /// @since C++14
> > > >>    template<typename _Tp>
> > > >>      struct is_final
> > > >> -    : public integral_constant<bool, __is_final(_Tp)>
> > > >> +    : public __bool_constant<__is_final(_Tp)>
> > > >>      { };
> > > >>  #endif
> > > >>
> > > >>    /// is_abstract
> > > >>    template<typename _Tp>
> > > >>      struct is_abstract
> > > >> -    : public integral_constant<bool, __is_abstract(_Tp)>
> > > >> +    : public __bool_constant<__is_abstract(_Tp)>
> > > >>      { };
> > > >>
> > > >>    /// @cond undocumented
> > > >> @@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>
> > > >>    template<typename _Tp>
> > > >>      struct __is_signed_helper<_Tp, true>
> > > >> -    : public integral_constant<bool, _Tp(-1) < _Tp(0)>
> > > >> +    : public __bool_constant<_Tp(-1) < _Tp(0)>
> > > >>      { };
> > > >>    /// @endcond
> > > >>
> > > >> @@ -1333,7 +1333,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    /// has_virtual_destructor
> > > >>    template<typename _Tp>
> > > >>      struct has_virtual_destructor
> > > >> -    : public integral_constant<bool, __has_virtual_destructor(_Tp)>
> > > >> +    : public __bool_constant<__has_virtual_destructor(_Tp)>
> > > >>      {
> > > >>        static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > > >>         "template argument must be a complete class or an unbounded array");
> > > >> @@ -1392,7 +1392,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    template<typename _Tp, typename _Up>
> > > >>      struct is_same
> > > >>  #ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
> > > >> -    : public integral_constant<bool, __is_same(_Tp, _Up)>
> > > >> +    : public __bool_constant<__is_same(_Tp, _Up)>
> > > >>  #else
> > > >>      : public false_type
> > > >>  #endif
> > > >> @@ -1408,7 +1408,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> > > >>    /// is_base_of
> > > >>    template<typename _Base, typename _Derived>
> > > >>      struct is_base_of
> > > >> -    : public integral_constant<bool, __is_base_of(_Base, _Derived)>
> > > >> +    : public __bool_constant<__is_base_of(_Base, _Derived)>
> > > >>      { };
> > > >>
> > > >>  #if __has_builtin(__is_convertible)
> > > >> --
> > > >> 2.40.0
> > > >>
> >
> >

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-17 21:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23  2:04 [PATCH] libstdc++: use __bool_constant instead of integral_constant Ken Matsui
2023-03-23  9:28 ` Jonathan Wakely
2023-03-23 10:17   ` Ken Matsui
2023-03-23 10:46     ` Ville Voutilainen
2023-03-23 10:53       ` Ken Matsui
2023-03-23 10:56         ` Ville Voutilainen
2023-03-23 11:00           ` Ken Matsui
2023-03-23 11:06             ` Ken Matsui
2023-04-08  1:02               ` PING: " Ken Matsui
2023-04-08  7:52               ` Jonathan Wakely
2023-04-08 21:08                 ` Ken Matsui
2023-05-13  3:22                   ` Ken Matsui
2023-05-17 15:53                     ` Patrick Palka
2023-05-17 21:14                       ` Ken Matsui

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).