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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-09-09
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |rejects-valid

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You can also use this as a workaround:
```
AA aa{Constructor([](auto& p) { p.x = 1; })};
```

Confirmed.
The problem is GCC starts parsing as a function declaration for aa that takes a
type of arrays of function pointers that has a function argument named
Constructor and then noticed the `{` and decides whoops we need to back up. But
it is too late as GCC already error'd for the auto too early on.

Basically GCC errors out on auto too soon (during the parsing) rather
afterwards ...
  • [Bug c++/111352... peter.fletcher at bandicootimaging dot com.au via Gcc-bugs
    • [Bug c++/1... peter.fletcher at bandicootimaging dot com.au via Gcc-bugs
    • [Bug c++/1... pinskia at gcc dot gnu.org via Gcc-bugs
    • [Bug c++/1... pinskia at gcc dot gnu.org via Gcc-bugs
    • [Bug c++/1... pinskia at gcc dot gnu.org via Gcc-bugs

Reply via email to