As discussed in
<https://gcc.gnu.org/pipermail/gcc-patches/2026-January/705756.html>.
Since we check eval_is_type in process_metafunction:
if (eval_is_type (ht) != boolean_true_node)
return throw_exception_nontype (loc, ctx, fun, non_constant_p,
jump_target);
finish_trait_expr should never return error_mark_node. We can ensure
that it's so by adding an assert.
gcc/cp/ChangeLog:
* reflect.cc (eval_type_trait): Assert that finish_trait_expr didn't
return error_mark_node.
Reviewed-by: Jason Merrill <jason@redhat.com>
eval_type_trait (location_t loc, tree type1, tree type2, cp_trait_kind kind)
{
tree r = finish_trait_expr (loc, kind, type1, type2);
+ gcc_checking_assert (r != error_mark_node);
STRIP_ANY_LOCATION_WRAPPER (r);
return r;
}