[PATCH 01/11] gcc/doc/extend.texi: Sort built-in traits alphabetically
This patch sorts built-in traits alphabetically for better codebase consistency and easier future integration of changes. gcc/ChangeLog: * doc/extend.texi (Type Traits): Sort built-in traits alphabetically. Signed-off-by: Ken Matsui --- gcc/doc/extend.texi | 62 ++--- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index f679c81acf2..b13f9d6f934 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -29499,15 +29499,6 @@ Requires: @var{type} shall be a complete type, (possibly cv-qualified) @code{void}, or an array of unknown bound. @enddefbuiltin -@defbuiltin{bool __has_nothrow_copy (@var{type})} -If @code{__has_trivial_copy (type)} is @code{true} then the trait is -@code{true}, else if @var{type} is a cv-qualified class or union type -with copy constructors that are known not to throw an exception then -the trait is @code{true}, else it is @code{false}. -Requires: @var{type} shall be a complete type, (possibly cv-qualified) -@code{void}, or an array of unknown bound. -@enddefbuiltin - @defbuiltin{bool __has_nothrow_constructor (@var{type})} If @code{__has_trivial_constructor (type)} is @code{true} then the trait is @code{true}, else if @var{type} is a cv class or union type (or array @@ -29517,6 +29508,15 @@ Requires: @var{type} shall be a complete type, (possibly cv-qualified) @code{void}, or an array of unknown bound. @enddefbuiltin +@defbuiltin{bool __has_nothrow_copy (@var{type})} +If @code{__has_trivial_copy (type)} is @code{true} then the trait is +@code{true}, else if @var{type} is a cv-qualified class or union type +with copy constructors that are known not to throw an exception then +the trait is @code{true}, else it is @code{false}. +Requires: @var{type} shall be a complete type, (possibly cv-qualified) +@code{void}, or an array of unknown bound. +@enddefbuiltin + @defbuiltin{bool __has_trivial_assign (@var{type})} If @var{type} is @code{const}- qualified or is a reference type then the trait is @code{false}. Otherwise if @code{__is_trivial (type)} is @@ -29527,15 +29527,6 @@ Requires: @var{type} shall be a complete type, (possibly cv-qualified) @code{void}, or an array of unknown bound. @enddefbuiltin -@defbuiltin{bool __has_trivial_copy (@var{type})} -If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference -type then the trait is @code{true}, else if @var{type} is a cv class -or union type with a trivial copy constructor ([class.copy]) then the trait -is @code{true}, else it is @code{false}. Requires: @var{type} shall be -a complete type, (possibly cv-qualified) @code{void}, or an array of unknown -bound. -@enddefbuiltin - @defbuiltin{bool __has_trivial_constructor (@var{type})} If @code{__is_trivial (type)} is @code{true} then the trait is @code{true}, else if @var{type} is a cv-qualified class or union type (or array thereof) @@ -29545,6 +29536,15 @@ Requires: @var{type} shall be a complete type, (possibly cv-qualified) @code{void}, or an array of unknown bound. @enddefbuiltin +@defbuiltin{bool __has_trivial_copy (@var{type})} +If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference +type then the trait is @code{true}, else if @var{type} is a cv class +or union type with a trivial copy constructor ([class.copy]) then the trait +is @code{true}, else it is @code{false}. Requires: @var{type} shall be +a complete type, (possibly cv-qualified) @code{void}, or an array of unknown +bound. +@enddefbuiltin + @defbuiltin{bool __has_trivial_destructor (@var{type})} If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference type then the trait is @code{true}, else if @var{type} is a cv class or union @@ -29560,6 +29560,13 @@ If @var{type} is a class type with a virtual destructor Requires: If @var{type} is a non-union class type, it shall be a complete type. @enddefbuiltin +@defbuiltin{bool __integer_pack (@var{length})} +When used as the pattern of a pack expansion within a template +definition, expands to a template argument pack containing integers +from @code{0} to @code{@var{length}-1}. This is provided for +efficient implementation of @code{std::make_integer_sequence}. +@enddefbuiltin + @defbuiltin{bool __is_abstract (@var{type})} If @var{type} is an abstract class ([class.abstract]) then the trait is @code{true}, else it is @code{false}. @@ -29589,12 +29596,6 @@ If @var{type} is a cv-qualified class type, and not a union type ([basic.compound]) the trait is @code{true}, else it is @code{false}. @enddefbuiltin -@c FIXME Commented out for GCC 13, discuss user interface for GCC 14. -@c @defbuiltin{bool __is_deducible (@var{template}, @var{type})} -@c If template arguments for @code{template} can be deduced from -@c @code{type} or obtained from default template arguments. -@c @enddefbuiltin - @defbuiltin{bool __is_empty (@var{type})} If @code{__is_class (type)} is @code{false}
Re: [PATCH 01/11] gcc/doc/extend.texi: Sort built-in traits alphabetically
Hi Dr. Brown, Sorry for forgetting to CC you. Could you please review my patch series when you get a chance? This patch series adds documentation only for built-ins I implemented. To minimize git conflicts, I will add documentation updates to my existing patches after this patch series gets merged. After that, I will try to add documentation to missing built-ins that I did not implement. Thank you! Sincerely, Ken Matsui On Fri, Mar 1, 2024 at 4:23 PM Ken Matsui wrote: > > This patch sorts built-in traits alphabetically for better codebase > consistency and easier future integration of changes. > > gcc/ChangeLog: > > * doc/extend.texi (Type Traits): Sort built-in traits > alphabetically. > > Signed-off-by: Ken Matsui > --- > gcc/doc/extend.texi | 62 ++--- > 1 file changed, 31 insertions(+), 31 deletions(-) > > diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi > index f679c81acf2..b13f9d6f934 100644 > --- a/gcc/doc/extend.texi > +++ b/gcc/doc/extend.texi > @@ -29499,15 +29499,6 @@ Requires: @var{type} shall be a complete type, > (possibly cv-qualified) > @code{void}, or an array of unknown bound. > @enddefbuiltin > > -@defbuiltin{bool __has_nothrow_copy (@var{type})} > -If @code{__has_trivial_copy (type)} is @code{true} then the trait is > -@code{true}, else if @var{type} is a cv-qualified class or union type > -with copy constructors that are known not to throw an exception then > -the trait is @code{true}, else it is @code{false}. > -Requires: @var{type} shall be a complete type, (possibly cv-qualified) > -@code{void}, or an array of unknown bound. > -@enddefbuiltin > - > @defbuiltin{bool __has_nothrow_constructor (@var{type})} > If @code{__has_trivial_constructor (type)} is @code{true} then the trait > is @code{true}, else if @var{type} is a cv class or union type (or array > @@ -29517,6 +29508,15 @@ Requires: @var{type} shall be a complete type, > (possibly cv-qualified) > @code{void}, or an array of unknown bound. > @enddefbuiltin > > +@defbuiltin{bool __has_nothrow_copy (@var{type})} > +If @code{__has_trivial_copy (type)} is @code{true} then the trait is > +@code{true}, else if @var{type} is a cv-qualified class or union type > +with copy constructors that are known not to throw an exception then > +the trait is @code{true}, else it is @code{false}. > +Requires: @var{type} shall be a complete type, (possibly cv-qualified) > +@code{void}, or an array of unknown bound. > +@enddefbuiltin > + > @defbuiltin{bool __has_trivial_assign (@var{type})} > If @var{type} is @code{const}- qualified or is a reference type then > the trait is @code{false}. Otherwise if @code{__is_trivial (type)} is > @@ -29527,15 +29527,6 @@ Requires: @var{type} shall be a complete type, > (possibly cv-qualified) > @code{void}, or an array of unknown bound. > @enddefbuiltin > > -@defbuiltin{bool __has_trivial_copy (@var{type})} > -If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > -type then the trait is @code{true}, else if @var{type} is a cv class > -or union type with a trivial copy constructor ([class.copy]) then the trait > -is @code{true}, else it is @code{false}. Requires: @var{type} shall be > -a complete type, (possibly cv-qualified) @code{void}, or an array of unknown > -bound. > -@enddefbuiltin > - > @defbuiltin{bool __has_trivial_constructor (@var{type})} > If @code{__is_trivial (type)} is @code{true} then the trait is @code{true}, > else if @var{type} is a cv-qualified class or union type (or array thereof) > @@ -29545,6 +29536,15 @@ Requires: @var{type} shall be a complete type, > (possibly cv-qualified) > @code{void}, or an array of unknown bound. > @enddefbuiltin > > +@defbuiltin{bool __has_trivial_copy (@var{type})} > +If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > +type then the trait is @code{true}, else if @var{type} is a cv class > +or union type with a trivial copy constructor ([class.copy]) then the trait > +is @code{true}, else it is @code{false}. Requires: @var{type} shall be > +a complete type, (possibly cv-qualified) @code{void}, or an array of unknown > +bound. > +@enddefbuiltin > + > @defbuiltin{bool __has_trivial_destructor (@var{type})} > If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > type > then the trait is @code{true}, else if @var{type} is a cv class or union > @@ -29560,6 +29560,13 @@ If @var{type} is a class type with a virtual > destructor > Requires: If @var{type} is a non-union class type, it shall be a complete > type. > @enddefbuiltin > > +@defbuiltin{bool __integer_pack (@var{length})} > +When used as the pattern of a pack expansion within a template > +definition, expands to a template argument pack containing integers > +from @code{0} to @code{@var{length}-1}. This is provided for > +efficient implementation of @code{std::make_integer_sequence}. > +@enddefbuiltin > + > @defbuiltin{bool __is_abstract (@var
Re: [PATCH 01/11] gcc/doc/extend.texi: Sort built-in traits alphabetically
Hi Ken, This patch series LGTM, thanks for these documentation improvements. On Fri, 1 Mar 2024, Ken Matsui wrote: > This patch sorts built-in traits alphabetically for better codebase > consistency and easier future integration of changes. > > gcc/ChangeLog: > > * doc/extend.texi (Type Traits): Sort built-in traits > alphabetically. > > Signed-off-by: Ken Matsui > --- > gcc/doc/extend.texi | 62 ++--- > 1 file changed, 31 insertions(+), 31 deletions(-) > > diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi > index f679c81acf2..b13f9d6f934 100644 > --- a/gcc/doc/extend.texi > +++ b/gcc/doc/extend.texi > @@ -29499,15 +29499,6 @@ Requires: @var{type} shall be a complete type, > (possibly cv-qualified) > @code{void}, or an array of unknown bound. > @enddefbuiltin > > -@defbuiltin{bool __has_nothrow_copy (@var{type})} > -If @code{__has_trivial_copy (type)} is @code{true} then the trait is > -@code{true}, else if @var{type} is a cv-qualified class or union type > -with copy constructors that are known not to throw an exception then > -the trait is @code{true}, else it is @code{false}. > -Requires: @var{type} shall be a complete type, (possibly cv-qualified) > -@code{void}, or an array of unknown bound. > -@enddefbuiltin > - > @defbuiltin{bool __has_nothrow_constructor (@var{type})} > If @code{__has_trivial_constructor (type)} is @code{true} then the trait > is @code{true}, else if @var{type} is a cv class or union type (or array > @@ -29517,6 +29508,15 @@ Requires: @var{type} shall be a complete type, > (possibly cv-qualified) > @code{void}, or an array of unknown bound. > @enddefbuiltin > > +@defbuiltin{bool __has_nothrow_copy (@var{type})} > +If @code{__has_trivial_copy (type)} is @code{true} then the trait is > +@code{true}, else if @var{type} is a cv-qualified class or union type > +with copy constructors that are known not to throw an exception then > +the trait is @code{true}, else it is @code{false}. > +Requires: @var{type} shall be a complete type, (possibly cv-qualified) > +@code{void}, or an array of unknown bound. > +@enddefbuiltin > + > @defbuiltin{bool __has_trivial_assign (@var{type})} > If @var{type} is @code{const}- qualified or is a reference type then > the trait is @code{false}. Otherwise if @code{__is_trivial (type)} is > @@ -29527,15 +29527,6 @@ Requires: @var{type} shall be a complete type, > (possibly cv-qualified) > @code{void}, or an array of unknown bound. > @enddefbuiltin > > -@defbuiltin{bool __has_trivial_copy (@var{type})} > -If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > -type then the trait is @code{true}, else if @var{type} is a cv class > -or union type with a trivial copy constructor ([class.copy]) then the trait > -is @code{true}, else it is @code{false}. Requires: @var{type} shall be > -a complete type, (possibly cv-qualified) @code{void}, or an array of unknown > -bound. > -@enddefbuiltin > - > @defbuiltin{bool __has_trivial_constructor (@var{type})} > If @code{__is_trivial (type)} is @code{true} then the trait is @code{true}, > else if @var{type} is a cv-qualified class or union type (or array thereof) > @@ -29545,6 +29536,15 @@ Requires: @var{type} shall be a complete type, > (possibly cv-qualified) > @code{void}, or an array of unknown bound. > @enddefbuiltin > > +@defbuiltin{bool __has_trivial_copy (@var{type})} > +If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > +type then the trait is @code{true}, else if @var{type} is a cv class > +or union type with a trivial copy constructor ([class.copy]) then the trait > +is @code{true}, else it is @code{false}. Requires: @var{type} shall be > +a complete type, (possibly cv-qualified) @code{void}, or an array of unknown > +bound. > +@enddefbuiltin > + > @defbuiltin{bool __has_trivial_destructor (@var{type})} > If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > type > then the trait is @code{true}, else if @var{type} is a cv class or union > @@ -29560,6 +29560,13 @@ If @var{type} is a class type with a virtual > destructor > Requires: If @var{type} is a non-union class type, it shall be a complete > type. > @enddefbuiltin > > +@defbuiltin{bool __integer_pack (@var{length})} > +When used as the pattern of a pack expansion within a template > +definition, expands to a template argument pack containing integers > +from @code{0} to @code{@var{length}-1}. This is provided for > +efficient implementation of @code{std::make_integer_sequence}. > +@enddefbuiltin > + > @defbuiltin{bool __is_abstract (@var{type})} > If @var{type} is an abstract class ([class.abstract]) then the trait > is @code{true}, else it is @code{false}. > @@ -29589,12 +29596,6 @@ If @var{type} is a cv-qualified class type, and not > a union type > ([basic.compound]) the trait is @code{true}, else it is @code{false}. > @enddefbuiltin > > -@c FIXME Commented out for GCC 13, dis
Re: [PATCH 01/11] gcc/doc/extend.texi: Sort built-in traits alphabetically
On Fri, Mar 8, 2024 at 8:38 AM Patrick Palka wrote: > > Hi Ken, > > This patch series LGTM, thanks for these documentation improvements. Thank you for your time to review! I actually have some changes to these patches, so I will re-send those to you once they are ready. > > On Fri, 1 Mar 2024, Ken Matsui wrote: > > > This patch sorts built-in traits alphabetically for better codebase > > consistency and easier future integration of changes. > > > > gcc/ChangeLog: > > > > * doc/extend.texi (Type Traits): Sort built-in traits > > alphabetically. > > > > Signed-off-by: Ken Matsui > > --- > > gcc/doc/extend.texi | 62 ++--- > > 1 file changed, 31 insertions(+), 31 deletions(-) > > > > diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi > > index f679c81acf2..b13f9d6f934 100644 > > --- a/gcc/doc/extend.texi > > +++ b/gcc/doc/extend.texi > > @@ -29499,15 +29499,6 @@ Requires: @var{type} shall be a complete type, > > (possibly cv-qualified) > > @code{void}, or an array of unknown bound. > > @enddefbuiltin > > > > -@defbuiltin{bool __has_nothrow_copy (@var{type})} > > -If @code{__has_trivial_copy (type)} is @code{true} then the trait is > > -@code{true}, else if @var{type} is a cv-qualified class or union type > > -with copy constructors that are known not to throw an exception then > > -the trait is @code{true}, else it is @code{false}. > > -Requires: @var{type} shall be a complete type, (possibly cv-qualified) > > -@code{void}, or an array of unknown bound. > > -@enddefbuiltin > > - > > @defbuiltin{bool __has_nothrow_constructor (@var{type})} > > If @code{__has_trivial_constructor (type)} is @code{true} then the trait > > is @code{true}, else if @var{type} is a cv class or union type (or array > > @@ -29517,6 +29508,15 @@ Requires: @var{type} shall be a complete type, > > (possibly cv-qualified) > > @code{void}, or an array of unknown bound. > > @enddefbuiltin > > > > +@defbuiltin{bool __has_nothrow_copy (@var{type})} > > +If @code{__has_trivial_copy (type)} is @code{true} then the trait is > > +@code{true}, else if @var{type} is a cv-qualified class or union type > > +with copy constructors that are known not to throw an exception then > > +the trait is @code{true}, else it is @code{false}. > > +Requires: @var{type} shall be a complete type, (possibly cv-qualified) > > +@code{void}, or an array of unknown bound. > > +@enddefbuiltin > > + > > @defbuiltin{bool __has_trivial_assign (@var{type})} > > If @var{type} is @code{const}- qualified or is a reference type then > > the trait is @code{false}. Otherwise if @code{__is_trivial (type)} is > > @@ -29527,15 +29527,6 @@ Requires: @var{type} shall be a complete type, > > (possibly cv-qualified) > > @code{void}, or an array of unknown bound. > > @enddefbuiltin > > > > -@defbuiltin{bool __has_trivial_copy (@var{type})} > > -If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > > -type then the trait is @code{true}, else if @var{type} is a cv class > > -or union type with a trivial copy constructor ([class.copy]) then the trait > > -is @code{true}, else it is @code{false}. Requires: @var{type} shall be > > -a complete type, (possibly cv-qualified) @code{void}, or an array of > > unknown > > -bound. > > -@enddefbuiltin > > - > > @defbuiltin{bool __has_trivial_constructor (@var{type})} > > If @code{__is_trivial (type)} is @code{true} then the trait is @code{true}, > > else if @var{type} is a cv-qualified class or union type (or array thereof) > > @@ -29545,6 +29536,15 @@ Requires: @var{type} shall be a complete type, > > (possibly cv-qualified) > > @code{void}, or an array of unknown bound. > > @enddefbuiltin > > > > +@defbuiltin{bool __has_trivial_copy (@var{type})} > > +If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > > +type then the trait is @code{true}, else if @var{type} is a cv class > > +or union type with a trivial copy constructor ([class.copy]) then the trait > > +is @code{true}, else it is @code{false}. Requires: @var{type} shall be > > +a complete type, (possibly cv-qualified) @code{void}, or an array of > > unknown > > +bound. > > +@enddefbuiltin > > + > > @defbuiltin{bool __has_trivial_destructor (@var{type})} > > If @code{__is_trivial (type)} is @code{true} or @var{type} is a reference > > type > > then the trait is @code{true}, else if @var{type} is a cv class or union > > @@ -29560,6 +29560,13 @@ If @var{type} is a class type with a virtual > > destructor > > Requires: If @var{type} is a non-union class type, it shall be a complete > > type. > > @enddefbuiltin > > > > +@defbuiltin{bool __integer_pack (@var{length})} > > +When used as the pattern of a pack expansion within a template > > +definition, expands to a template argument pack containing integers > > +from @code{0} to @code{@var{length}-1}. This is provided for > > +efficient implementation of @code{std::make_integer_sequence}. > > +@enddefbuiltin > > +