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

            Bug ID: 116289
           Summary: [13.3 regression] Can't apply decltype to comparison
                    operators created by spaceship operator for local
                    classes
           Product: gcc
           Version: 13.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: iamsupermouse at mail dot ru
  Target Milestone: ---

This bug only affects 13.3. Works fine in 13.2 and in 14.x.
Having this fixed in 13.x branch would be nice, since it affects `std::less{}`.

The following code doesn't compile: (running `g++ -std=c++20`)

https://gcc.godbolt.org/z/bodKevcvc

    #include <compare>

    int main()
    {
        struct A
        {
            int x = 0;
            auto operator<=>(const A &) const = default;
        };
        decltype(A{} < A{}) y;
    }

With following error:

    In member function 'constexpr auto main()::A::operator<=>(const main()::A&)
const':
    cc1plus: error: taking address of an immediate function 'consteval
std::__cmp_cat::__unspec::__unspec(std::__cmp_cat::__unspec*)'

Reply via email to