https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118387
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 60085 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60085&action=edit gcc15-pr118387.patch Untested fix for the ICE. Or: --- gcc/cp/method.cc.jj2025-01-08 23:11:23.375456869 +0100 +++ gcc/cp/method.cc2025-01-09 19:06:05.529933600 +0100 @@ -1097,8 +1097,8 @@ genericize_spaceship (location_t loc, tr if (type == error_mark_node) return error_mark_node; } - - gcc_checking_assert (tag < cc_last); + else if (tag == cc_last) + return error_mark_node; tree r; bool scalar = SCALAR_TYPE_P (TREE_TYPE (op0)); would do the same job I think as well. As for the empty struct with defaulted <=> operator with non-standard return type, I'd like to hear first from some C++ lawyer on what exactly should happen in that case.