[Bug c++/107889] Incorrect parsing of qualified friend function returning decltype(auto)

2022-11-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107889

--- Comment #3 from Jonathan Wakely  ---
(In reply to David Mazières from comment #0)
> A similar problem was reported in bug #59766 for friend functions returning
> auto.

That's unrelated.

The problem here is that decltype(auto)::f is a nested-name-specifier for a
member 'f' so is parsed as part of the return type, not the function name. This
is what C++20 (and all earlier standards) said. The ambiguity has been resolved
as a DR against earlier standards, but GCC doesn't implement that change yet,
as shown at https://gcc.gnu.org/projects/cxx-status.html#cxx23

[Bug c++/107889] Incorrect parsing of qualified friend function returning decltype(auto)

2022-11-28 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107889

--- Comment #2 from Jonathan Wakely  ---
I think this is https://wg21.link/cwg1828 which was resolved by
https://wg21.link/p1787 which GCC does not implement yet.

[Bug c++/107889] Incorrect parsing of qualified friend function returning decltype(auto)

2022-11-27 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107889

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2022-11-28
 CC||marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
Clang accepts the code.