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

            Bug ID: 92495
           Summary: spaceship operator requires public member
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: klaus.doldinger64 at googlemail dot com
  Target Milestone: ---

The below example only compiles with public member:

#include <compare> // omitting trigger ICE

template<auto V>
struct A {};

struct B {
    inline constexpr auto operator<=>(const B& rhs) const = default;
//private:
    int value; // why must this member be public?
};

int main() {
    A<B{}> t;
}

Reply via email to