https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119284
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- N.B. the error didn't happen because the wrong overload was selection, it happened while doing overload resolution to see if it _should_ be selected. This problem is precisely why the monadic operations of std::optional in C++23 are *not* constrained. If we put std::invocable constraints on them, it would cause exactly this error for generic lambdas.