https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95567
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:e84436a273f0fbb42b9785ff5bb1deaf9a500f37 commit r11-9084-ge84436a273f0fbb42b9785ff5bb1deaf9a500f37 Author: Patrick Palka <ppa...@redhat.com> Date: Thu Sep 30 17:29:05 2021 -0400 c++: defaulted comparisons and vptr fields [PR95567] We need to explicitly skip over vptr fields when synthesizing a defaulted comparison operator, because next_initializable_field doesn't do so for us. PR c++/95567 gcc/cp/ChangeLog: * method.c (build_comparison_op): Skip DECL_VIRTUAL_P fields. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/spaceship-virtual1.C: New test. (cherry picked from commit b6bca2e631b54f992c058ca8e445b45e9816690b)