On Tue, Sep 28, 2021 at 10:34:39PM +0200, Jakub Jelinek via Gcc-patches wrote: > On Tue, Sep 28, 2021 at 03:33:35PM -0400, Jason Merrill wrote: > > > > According to the function comment for defaulted_late_check, won't > > > > COMPLETE_TYPE_P (ctx) always be false here? > > > > Not for a function defaulted outside the class. > > > > > If so, I wonder if we could get away with moving this entire fragment > > > from defaulted_late_check to finish_struct_1 instead of calling > > > defaulted_late_check from finish_struct_1. > > > > The comment in check_bases_and_members says that we call it there so that > > it's before we clone [cd]tors. Probably better to leave the call there for > > other functions, just skip it for comparisons. > > So like this instead then? Just tested with dg.exp=*spaceship* so far. > > 2021-09-28 Jakub Jelinek <ja...@redhat.com> > > PR c++/102490 > * method.c (defaulted_late_check): Don't synthetize constexpr > defaulted comparisons. > (finish_struct_1): Synthetize constexpr defaulted comparisons here > after layout_class_type. > > * g++.dg/cpp2a/spaceship-eq11.C: New test. > * g++.dg/cpp2a/spaceship-eq12.C: New test.
Also successfully bootstrapped/regtested on x86_64-linux and i686-linux. Jakub