https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110084
--- Comment #5 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:28f95c81382243fc4e6f1b22741d258f5fd7541f commit r12-10129-g28f95c81382243fc4e6f1b22741d258f5fd7541f Author: Jason Merrill <ja...@redhat.com> Date: Fri Feb 2 12:04:11 2024 -0500 c++: op== defaulted outside class [PR110084] defaulted_late_check is for checks that need to happen after the class is complete; we shouldn't call it sooner. PR c++/110084 gcc/cp/ChangeLog: * pt.cc (tsubst_function_decl): Only check a function defaulted outside the class if the class is complete. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/spaceship-synth-neg3.C: Check error message. * g++.dg/cpp2a/spaceship-eq16.C: New test. (cherry picked from commit e17a122d417fc0d606bcb3a3705b93ee81745cab)