This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 120b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2026-07-26
Consider:
struct A { friend int operator<=>(A,A); };
struct B { A a; friend auto operator<=>(const B&) const = default; };
using Q = [: return_type_of(^^B::operator<=>) :];
What is the type Q?
Traditionally, CWG had the viewpoint that querying properties of deleted functions (e.g. triviality) should be impossible or ill-formed. Note that reflection prohibits querying undeduced return types (21.4.7 [meta.reflection.queries] paragraph 1), so leaving undeduced the return type of deleted functions would fix the issue.
Proposed resolution (no objections during CWG reflector review started 2026-07-13):
Change in 11.10.3 [class.spaceship] bullet 2.1 as follows:
Let R be the declared return type of a defaulted three-way comparison operator function, and let xi be the elements of the expanded list of subobjects for an object x of type C.
- If R is auto, then let cv i Ri be the type of the expression xi <=> xi . The operator function is defined as deleted if that expression is not usable or if Ri is not a comparison category type (17.12.2.1 [cmp.categories.pre]) for any i.
TheOtherwise, the return type is deduced as the common comparison type (see below) of R0, R1, ..., Rn-1.- ...