diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-06-26 16:15:20 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-06-26 16:15:20 +0200 |
commit | 29c7661c6f92d80f63a9a3cc37f3dc790a161f3f (patch) | |
tree | 8aaa22d294e8790757a52568d043fd05208225f7 /libstdc++-v3/testsuite/std | |
parent | f8f7ace4f20829f2fad87662f5163c9b13427e39 (diff) | |
download | gcc-29c7661c6f92d80f63a9a3cc37f3dc790a161f3f.zip gcc-29c7661c6f92d80f63a9a3cc37f3dc790a161f3f.tar.gz gcc-29c7661c6f92d80f63a9a3cc37f3dc790a161f3f.tar.bz2 |
c++, libstdc++: Implement C++26 P2830R10 - Constexpr Type Ordering
The following patch attempts to implement the C++26 P2830R10 - Constexpr Type
Ordering paper, with a minor change that std::type_order<T, U> class template
doesn't derive from integer_constant, because std::strong_ordering is not
a structural type (except in MSVC), so instead it is just a class template
with static constexpr strong_ordering value member and also value_type,
type and 2 operators.
The paper mostly talks about using something other than mangled names for
the ordering, but given that the mangler is part of the GCC C++ FE, using
the mangler seems to be the best ordering choice to me.
2025-06-26 Jakub Jelinek <jakub@redhat.com>
gcc/cp/
* cp-trait.def: Implement C++26 P2830R10 - Constexpr Type Ordering.
(TYPE_ORDER): New.
* method.cc (type_order_value): Define.
* cp-tree.h (type_order_value): Declare.
* semantics.cc (trait_expr_value): Use gcc_unreachable also
for CPTK_TYPE_ORDER, adjust comment.
(finish_trait_expr): Handle CPTK_TYPE_ORDER.
* constraint.cc (diagnose_trait_expr): Likewise.
gcc/testsuite/
* g++.dg/cpp26/type-order1.C: New test.
* g++.dg/cpp26/type-order2.C: New test.
* g++.dg/cpp26/type-order3.C: New test.
libstdc++-v3/
* include/bits/version.def (type_order): New.
* include/bits/version.h: Regenerate.
* libsupc++/compare: Define __glibcxx_want_type_order before
including bits/version.h.
(std::type_order, std::type_order_v): New trait and template variable.
* src/c++23/std.cc.in (std::type_order, std::type_order_v): Export.
* testsuite/18_support/comparisons/type_order/1.cc: New test.
Diffstat (limited to 'libstdc++-v3/testsuite/std')
0 files changed, 0 insertions, 0 deletions