[PATCH 2/2] libstdc++: use new built-in trait __is_const

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_const. libstdc++-v3/ChangeLog: * include/std/type_traits (is_const): Use __is_const built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH 1/2] c++: implement __is_const built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_const. gcc/cp/ChangeLog: * cp-trait.def: Define __is_const. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONST. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

[PATCH 2/2] libstdc++: use new built-in trait __is_array

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_array. libstdc++-v3/ChangeLog: * include/std/type_traits (is_array): Use __is_array built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH 1/2] c++: implement __is_array built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_array. gcc/cp/ChangeLog: * cp-trait.def: Define __is_array. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARRAY. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

[PATCH v2 2/2] libstdc++: use new built-in trait __is_unsigned

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_unsigned. libstdc++-v3/ChangeLog: * include/std/type_traits (is_unsigned): Use __is_unsigned built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH v2 1/2] c++: implement __is_unsigned built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_unsigned. gcc/cp/ChangeLog: * cp-trait.def: Define __is_unsigned. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNSIGNED. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

Re: [PATCH 2/2] libstdc++: use new built-in trait __is_unsigned

2023-03-21 Thread Ken Matsui via Gcc-patches
I see. Thank you! On Tue, Mar 21, 2023 at 9:44 AM Jonathan Wakely wrote: > > > On Tue, 21 Mar 2023 at 16:41, Ken Matsui via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> This patch lets libstdc++ use new built-in trait __is_unsigned. >> >> libstdc++-v3/ChangeLog: >> >> *

[PATCH 2/2] libstdc++: use new built-in trait __is_unsigned

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_unsigned. libstdc++-v3/ChangeLog: * include/std/type_traits (is_unsigned): Use __is_unsigned built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH 1/2] c++: implement __is_unsigned built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_unsigned. gcc/cp/ChangeLog: * cp-trait.def: Define __is_unsigned. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNSIGNED. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

[PATCH 2/2] libstdc++: use new built-in trait __is_function

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH 1/2] c++: implement __is_function built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

Re: [PATCH 2/2] libstdc++: use new built-in trait __add_const

2023-03-21 Thread Ken Matsui via Gcc-patches
Thank you for your information. Although it matches my intuition, I sent this patch because I was unsure my intuition was correct. As Jonathan pointed out, there appear to be several implementation errors. The benchmark result for this trait is kind of trivial, so I will implement the other traits

[PATCH 1/2] c++: implement __add_const built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::add_const. gcc/cp/ChangeLog: * cp-trait.def: Define __add_const. * semantics.cc (finish_trait_type): Handle CPTK_ADD_CONST. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __add_const. *

[PATCH 2/2] libstdc++: use new built-in trait __add_const

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __add_const. libstdc++-v3/ChangeLog: * include/std/type_traits (add_const): Use __add_const built-in trait. --- libstdc++-v3/include/std/type_traits | 6 ++ 1 file changed, 6 insertions(+) diff --git

Re: [PATCH] c++: implement __add_pointer built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
Please disregard this patch. On Mon, Mar 20, 2023 at 12:44 AM Ken Matsui wrote: > This patch implements built-in trait for std::add_pointer. > > gcc/cp/ChangeLog: > > * cp-trait.def: Define __add_pointer. > * semantics.cc (finish_trait_type): Handle CPTK_ADD_POINTER. > >

Re: [PATCH] libstdc++: use new built-in trait __remove_pointer

2023-03-20 Thread Ken Matsui via Gcc-patches
Please disregard this email. On Mon, Mar 20, 2023 at 6:26 AM Ken Matsui wrote: > Thank you! > > On Mon, Mar 20, 2023 at 2:12 AM Jonathan Wakely > wrote: > >> On Mon, 20 Mar 2023 at 08:08, Ken Matsui >> wrote: >> > >> > Ooh... Thank you for pointing that out! >> > >> > > The helper doesn't

Re: [PATCH] c++: implement __remove_pointer built-in trait

2023-03-20 Thread Ken Matsui via Gcc-patches
Please disregard this email. On Sun, Mar 19, 2023 at 1:21 PM Ken Matsui wrote: > This patch implements built-in trait for std::remove_pointer. > > gcc/cp/ChangeLog: > > * cp-trait.def: Define __remove_pointer. > * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_POINTER. > >

[PATCH 2/2] libstdc++: use new built-in trait __remove_pointer

2023-03-20 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __remove_pointer. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_pointer): Use __remove_pointer built-in trait. --- libstdc++-v3/include/std/type_traits | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff

[PATCH 1/2] c++: implement __remove_pointer built-in trait

2023-03-20 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::remove_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __remove_pointer. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_POINTER. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of

Re: [PATCH] libstdc++: use new built-in trait __is_reference

2023-03-20 Thread Ken Matsui via Gcc-patches
Thank you so much for taking the benchmark! This is a great improvement than I thought. In GCC contributions, do I need to benchmark (and report) every built-in trait I implement? On Mon, Mar 20, 2023 at 8:24 AM Patrick Palka wrote: > On Mon, Mar 20, 2023 at 5:56 AM Ken Matsui > wrote: > > >

Re: [PATCH] libstdc++: use new built-in trait __remove_pointer

2023-03-20 Thread Ken Matsui via Gcc-patches
Thank you! On Mon, Mar 20, 2023 at 2:12 AM Jonathan Wakely wrote: > On Mon, 20 Mar 2023 at 08:08, Ken Matsui > wrote: > > > > Ooh... Thank you for pointing that out! > > > > > The helper doesn't need to be defined for the case where we don't use > it. > > > > I thought that macroing them out

Re: [PATCH] c++: implement __is_reference built-in trait

2023-03-20 Thread Ken Matsui via Gcc-patches
I created new patches which is a series, but I couldn't figure out how to associate them with this email and another email. Please disregard this email. On Sun, Mar 19, 2023 at 1:19 PM Ken Matsui wrote: > > * cp-trait.def (names_builtin_p): Define __is_reference. > > This changelog should be the

Re: [PATCH] libstdc++: use new built-in trait __is_reference

2023-03-20 Thread Ken Matsui via Gcc-patches
It looks like I was able to use git send-email. The new patches became a series, so I couldn't figure out how to associate them with this email and another email. Please disregard this email. On Mon, Mar 20, 2023 at 2:56 AM Ken Matsui wrote: > > > Does it actually make compilation faster though?

[PATCH 2/2] libstdc++: use new built-in trait __is_reference

2023-03-20 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_reference. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH 1/2] c++: implement __is_reference built-in trait

2023-03-20 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

Re: [PATCH] libstdc++: use new built-in trait __is_reference

2023-03-20 Thread Ken Matsui via Gcc-patches
> Does it actually make compilation faster though? > > Has it been measured? In my understanding, what I have implemented so far is so simple that it does not affect the speed. These traits are what Partick kindly recommended to get started. As explained on the GSoC page, some traits might

Re: [PATCH] libstdc++: use new built-in trait __is_reference

2023-03-20 Thread Ken Matsui via Gcc-patches
Thank you! On Mon, Mar 20, 2023 at 1:07 AM Xi Ruoyao wrote: > > On Mon, 2023-03-20 at 01:03 -0700, Ken Matsui wrote: > > Oops, I assumed those were my email... Thank you for your heads up and > > your comments! > > > > > Bad ChangeLog format. You should have a tab (not 4 or 8 spaces, nor > > >

Re: [PATCH] libstdc++: use new built-in trait __remove_pointer

2023-03-20 Thread Ken Matsui via Gcc-patches
Ooh... Thank you for pointing that out! > The helper doesn't need to be defined for the case where we don't use it. I thought that macroing them out leads to compiler errors since users are possibly using those helpers. But do we not have to care about that? --- libstdc++-v3/ChangeLog: *

Re: [PATCH] libstdc++: use new built-in trait __is_reference

2023-03-20 Thread Ken Matsui via Gcc-patches
continue to read. I guess you missed some inline comments from > me... > > > > > On Mon, Mar 20, 2023 at 12:26 AM Xi Ruoyao wrote: > > > > > > You need to CC libstd...@gcc.gnu.org for any patches touching > > > libstdc++. > > > > > > On Sat, 202

[PATCH] c++: implement __add_pointer built-in trait

2023-03-20 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::add_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __add_pointer. * semantics.cc (finish_trait_type): Handle CPTK_ADD_POINTER. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __add_pointer. * g++.dg/ext/add_pointer.C:

Re: [PATCH] libstdc++: use new built-in trait __remove_pointer

2023-03-20 Thread Ken Matsui via Gcc-patches
CCing libstd...@gcc.gnu.org. On Sun, Mar 19, 2023 at 7:53 PM Ken Matsui wrote: > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_reference): Use __remove_pointer built-in trait. > > --- > diff --git a/libstdc++-v3/include/std/type_traits > b/libstdc++-v3/include/std/type_traits >

Re: [PATCH] libstdc++: use new built-in trait __is_reference

2023-03-20 Thread Ken Matsui via Gcc-patches
I see. Thank you! On Mon, Mar 20, 2023 at 12:26 AM Xi Ruoyao wrote: > > You need to CC libstd...@gcc.gnu.org for any patches touching libstdc++. > > On Sat, 2023-03-18 at 21:21 -0700, Ken Matsui via Gcc-patches wrote: > > libstdc++-v3/ChangeLog: > > > > * include

[PATCH] libstdc++: use new built-in trait __remove_pointer

2023-03-19 Thread Ken Matsui via Gcc-patches
libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __remove_pointer built-in trait. --- diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2bd607a8b8f..cba98091aad 100644 --- a/libstdc++-v3/include/std/type_traits +++

[PATCH] c++: implement __remove_pointer built-in trait

2023-03-19 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::remove_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __remove_pointer. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_POINTER. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __remove_pointer. *

Re: [PATCH] c++: implement __is_reference built-in trait

2023-03-19 Thread Ken Matsui via Gcc-patches
* cp-trait.def (names_builtin_p): Define __is_reference. This changelog should be the following. * cp-trait.def: Define __is_reference. I am sorry for the confusion. On Sat, Mar 18, 2023 at 9:07 PM Ken Matsui wrote: > > This patch implements built-in trait for std::is_reference. > >

[PATCH] libstdc++: use new built-in trait __is_reference

2023-03-18 Thread Ken Matsui via Gcc-patches
libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. --- diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2bd607a8b8f..18408d8ceb6 100644 --- a/libstdc++-v3/include/std/type_traits +++

[PATCH] c++: implement __is_reference built-in trait

2023-03-18 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def (names_builtin_p): Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

<    1   2   3   4   5