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

            Bug ID: 102208
           Summary: Acceptance of invalid decltype(auto) in the default
                    operator <=>
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

GCC accepts invalid:
```
struct A { decltype(auto) operator <=>(const A &) const = default; };

```
https://gcc.godbolt.org/z/h1xxboGa9

The correct program must have simply `auto`:
```
struct A { auto operator <=>(const A &) const = default; };

```

Reply via email to