[Bug c++/94061] defaulted member operator <=> defined as deleted if a base has protected member operator <=>

f.heckenbach@fh-soft.de gcc-bugzilla@gcc.gnu.org
Sat Jan 8 01:06:12 GMT 2022


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

Frank Heckenbach <f.heckenbach@fh-soft.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |f.heckenbach@fh-soft.de

--- Comment #1 from Frank Heckenbach <f.heckenbach@fh-soft.de> ---
I ran into the same problem.

Interestingly, clang also seems to reject it, so maybe it is wrong by the
letter of the standard? Though it would seem strange to me -- after all, when
manually implementing B::operator<=> a protected operator in A will do fine.

I hope someone who knows the standard more intimately can confirm whether
that's so and possibly open a defect report to the standard.

Fun fact: When I independently created a minimal test program, my result was
exactly identical to yours (modulo whitespace), including the names of the
structs. :)


More information about the Gcc-bugs mailing list