https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107291
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:db8d5b0ad074344559b3201e567c1e47e65d0bdd commit r12-10138-gdb8d5b0ad074344559b3201e567c1e47e65d0bdd Author: Jason Merrill <ja...@redhat.com> Date: Mon Feb 5 19:56:45 2024 -0500 c++: defaulted op== for incomplete class [PR107291] After complaining about lack of friendship, we should not try to go on and define the defaulted comparison operator anyway. PR c++/107291 gcc/cp/ChangeLog: * method.cc (early_check_defaulted_comparison): Fail if not friend. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/spaceship-eq17.C: New test. (cherry picked from commit c5d34912ad576be1ef19be92f7eabde54b9089eb)