[Bug c++/95567] Defaulted virtual <=> has the wrong behavior, vtable is checked when it should not be

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 30 21:51:48 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95567

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:b6bca2e631b54f992c058ca8e445b45e9816690b

commit r12-3995-gb6bca2e631b54f992c058ca8e445b45e9816690b
Author: Patrick Palka <ppalka@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.


More information about the Gcc-bugs mailing list