[Bug c++/119284] Overload resolution selects wrong overload with `std::invocable` concept and `auto &` in lambda parameter
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 14 12:46:55 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119284
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC is correct to reject this code.
In order to test whether the lambda is invocable it needs to be instantiated,
which triggers an error in the lambda body. That is outside the immediate
context of the concept check.
More information about the Gcc-bugs
mailing list