https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94478
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:a6479aa4c0532ee9ad1f098b4e82de9dc684e036 commit r10-7619-ga6479aa4c0532ee9ad1f098b4e82de9dc684e036 Author: Marek Polacek <pola...@redhat.com> Date: Tue Apr 7 14:24:52 2020 -0400 c++: ICE with defaulted comparison operator [PR94478] Here we ICE because early_check_defaulted_comparison passed a null ctx to same_type_p. The attached test is ill-formed according to [class.compare.default]/1, so fixed by detecting this case early. PR c++/94478 - ICE with defaulted comparison operator * method.c (early_check_defaulted_comparison): Give an error when the context is null. * g++.dg/cpp2a/spaceship-err4.C: New test.