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

2021-10-06 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95567

Patrick Palka  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |11.3

--- Comment #5 from Patrick Palka  ---
Fixed for GCC 11.3 and 12.

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

2021-10-06 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95567

--- Comment #4 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Patrick Palka
:

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

commit r11-9084-ge84436a273f0fbb42b9785ff5bb1deaf9a500f37
Author: Patrick Palka 
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)

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

2021-09-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95567

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

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

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

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

2021-09-29 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95567

Patrick Palka  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
 CC||ppalka at gcc dot gnu.org
 Status|NEW |ASSIGNED

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

2021-08-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95567

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2020-10-28 00:00:00 |2021-8-10
Summary|Defaulted virtual <=> has   |Defaulted virtual <=> has
   |the wrong behavior  |the wrong behavior, vtable
   ||is checked when it should
   ||not be

--- Comment #2 from Andrew Pinski  ---
Right it is checking the vtable for equality.