MongoDB now compiles with C++ 20 but some of the third-party code uses removed C++ features.
src/third_party/asio-master/asio/include/asio/detail/type_traits.hpp is using std::result_of which was removed in C++20. This can be worked around by either ASIO_HAS_STD_INVOKE_RESULT to make ASIO define it or _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS to undo the removal. The former is likely better since it has a more narrow affect in the code base.