]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: defaulted comparisons and vptr fields [PR95567]
authorPatrick Palka <ppalka@redhat.com>
Thu, 30 Sep 2021 21:29:05 +0000 (17:29 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 6 Oct 2021 13:43:14 +0000 (09:43 -0400)
commite84436a273f0fbb42b9785ff5bb1deaf9a500f37
tree50ba76304ab832f288565db5faf7b8b6213652f0
parent1682576e62d41cd761472943372b83aee514254a
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)
gcc/cp/method.c
gcc/testsuite/g++.dg/cpp2a/spaceship-virtual1.C [new file with mode: 0644]