Files
gcc/libstdc++-v3/include
Jakub Jelinek 1e38d1a4f4 c++, libstdc++: Implement P3856R8 - New reflection metafunction - is_structural_type
This patch attempts to implement this paper, adds a new trait, builtin trait
and metafunction.

2026-04-03  Jakub Jelinek  <jakub@redhat.com>

gcc/cp/
	* cp-trait.def (__builtin_is_structural): New trait.
	* semantics.cc (trait_expr_value): Handle CPTK_IS_STRUCTURAL.
	(finish_trait_expr): Likewise.
	* constraint.cc (diagnose_trait_expr): Likewise.
	* metafns.gperf (enum metafn_code): Add METAFN_IS_STRUCTURAL_TYPE.
	(is_structural_type): New metafn.
	* metafns.h: Regenerate.
	* reflect.cc (eval_is_structural_type): New function.
	(process_metafunction): Handle METAFN_IS_STRUCTURAL_TYPE.
gcc/testsuite/
	* g++.dg/reflect/type_trait14.C: New test.
	* g++.dg/reflect/eh1.C: Add test for is_structural_type.
	* g++.dg/reflect/eh2.C: Likewise.
libstdc++-v3/
	* include/bits/version.def (is_structural): New.
	* include/bits/version.h: Regenerate.
	* include/std/type_traits (__glibcxx_want_is_structural): Define.
	(std::is_structural): New type trait.
	(std::is_structural_v): New type trait variable template.
	* include/std/meta (std::meta::is_structural_type): New declaration.
	* src/c++23/std.cc.in: Export std::is_structural, std::is_structural_v
	and std::meta::is_structural_type.
	* testsuite/20_util/is_structural/requirements/explicit_instantiation.cc: New test.
	* testsuite/20_util/is_structural/requirements/typedefs.cc: New test.
	* testsuite/20_util/is_structural/value.cc: New test.
	* testsuite/20_util/variable_templates_for_traits.cc: Test
	is_structural_v.

Reviewed-by: Jason Merrill <jason@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2026-04-03 20:52:55 +02:00
..
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00