[PATCH] libstdc++: Expand tests for std::type_order.

Jonathan Wakely jwakely@redhat.com
Wed Apr 22 11:36:19 GMT 2026


On Wed, 22 Apr 2026 at 11:59, Tomasz Kamiński <tkaminsk@redhat.com> wrote:
>
> Expanded test coverage to include:
> * array of unknown bounds
> * function types and pointers
> * data and function member pointers
>
> libstdc++-v3/ChangeLog:
>
>         * testsuite/18_support/comparisons/type_order/1.cc: New test.

"tests" (otherwise it looks like the entire file is new).

Maybe "Add tests for more types" would be a better description.

>
> gcc/testsuite/ChangeLog:
>
>         * g++.dg/cpp26/type-order1.C: New tests.

Here too.

The library part is OK with a better changelog.

> ---
> Tested all *type_order* test both for libstdc++ and g++.
> OK for trunk?
>
>  gcc/testsuite/g++.dg/cpp26/type-order1.C      | 21 +++++++++++++++++++
>  .../18_support/comparisons/type_order/1.cc    | 21 +++++++++++++++++++
>  2 files changed, 42 insertions(+)
>
> diff --git a/gcc/testsuite/g++.dg/cpp26/type-order1.C b/gcc/testsuite/g++.dg/cpp26/type-order1.C
> index d5693570a47..bc7e87644a9 100644
> --- a/gcc/testsuite/g++.dg/cpp26/type-order1.C
> +++ b/gcc/testsuite/g++.dg/cpp26/type-order1.C
> @@ -92,3 +92,24 @@ constexpr eq <W, W> r;
>  constexpr ne <V, W> s;
>  constexpr eq <U <W>, U <W>> t;
>  constexpr ne <U <V>, U <W>> u;
> +
> +constexpr eq <int[], int[]> v;
> +constexpr ne <int[], int[2]> w;
> +constexpr eq <S[], S[]> x;
> +constexpr ne <S[], S[2]> y;
> +
> +constexpr eq <int (), int ()> z;
> +constexpr eq <int () noexcept, int () noexcept> aa;
> +constexpr ne <int (), int () noexcept> ab;
> +constexpr eq <int () const, int () const> ac;
> +constexpr ne <int (), int () const> ad;
> +constexpr eq <int () &, int () &> ae;
> +constexpr ne <int (), int () &> af;
> +constexpr eq <int (*)() noexcept, int (*)() noexcept> ag;
> +constexpr ne <int (), int (*)()> ah;
> +
> +constexpr eq <int V::*, int V::*> ba;
> +constexpr ne <int V::*, long V::*> bb;
> +constexpr eq <int (V::*)() const& noexcept, int (V::*)() const& noexcept> bc;
> +constexpr ne <int (V::*)(), long (V::*)()> bd;
> +constexpr ne <int (V::*)(), int (*)()> be;
> diff --git a/libstdc++-v3/testsuite/18_support/comparisons/type_order/1.cc b/libstdc++-v3/testsuite/18_support/comparisons/type_order/1.cc
> index 63864fa98b4..7c428a93f96 100644
> --- a/libstdc++-v3/testsuite/18_support/comparisons/type_order/1.cc
> +++ b/libstdc++-v3/testsuite/18_support/comparisons/type_order/1.cc
> @@ -93,3 +93,24 @@ constexpr eq <W, W> r;
>  constexpr ne <V, W> s;
>  constexpr eq <U <W>, U <W>> t;
>  constexpr ne <U <V>, U <W>> u;
> +
> +constexpr eq <int[], int[]> v;
> +constexpr ne <int[], int[2]> w;
> +constexpr eq <S[], S[]> x;
> +constexpr ne <S[], S[2]> y;
> +
> +constexpr eq <int (), int ()> z;
> +constexpr eq <int () noexcept, int () noexcept> aa;
> +constexpr ne <int (), int () noexcept> ab;
> +constexpr eq <int () const, int () const> ac;
> +constexpr ne <int (), int () const> ad;
> +constexpr eq <int () &, int () &> ae;
> +constexpr ne <int (), int () &> af;
> +constexpr eq <int (*)() noexcept, int (*)() noexcept> ag;
> +constexpr ne <int (), int (*)()> ah;
> +
> +constexpr eq <int V::*, int V::*> ba;
> +constexpr ne <int V::*, long V::*> bb;
> +constexpr eq <int (V::*)() const& noexcept, int (V::*)() const& noexcept> bc;
> +constexpr ne <int (V::*)(), long (V::*)()> bd;
> +constexpr ne <int (V::*)(), int (*)()> be;
> --
> 2.53.0
>



More information about the Libstdc++ mailing list