https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94973
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- Further reduced: #include <range/v3/algorithm/find.hpp> struct X { }; using F = int (X::*)() const; using I = X*; using R1 = ranges::invoke_result_t<F&, X&>; static_assert( std::is_same_v<R1, int> ); This fails because R1 is int (X::)() const which is nonsense. (In reply to DB from comment #3) > I chose libstdc++ because I figured it was more likely that some corner case > of std::invoke() was ultimately being hit, rather than the core compiler > being at fault. I guess not. std::invoke is not even used, ranges-v3 provides its own invoke.