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

            Bug ID: 118307
           Summary: Odd error message for &ctor(){}
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
struct A {
    &A(){}
};

```

Currently GCC gives:
```
<source>:2:8: error: cannot declare reference to 'void'
    2 |     &A(){}
      |        ^
```

But that is just a bogus error message. void is not even there.

I suspect this might be the same underlying issue as PR 118306.

Reply via email to