https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125450
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We need this:
--- a/libstdc++-v3/include/std/optional
+++ b/libstdc++-v3/include/std/optional
@@ -2286,9 +2286,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
ranges::enable_borrowed_range<optional<_Tp&>> = true;
#endif
+#if _GLIBCXX_HOSTED
template<typename _Tp>
inline constexpr range_format
format_kind<optional<_Tp>> = range_format::disabled;
+#endif
#endif // __cpp_lib_optional_range_support
#undef _GLIBCXX_USE_CONSTRAINTS_FOR_OPTIONAL