libstdc++-v3/ChangeLog:
PR libstdc++/125450
* include/std/optional (range_format): Do not define for
freestanding.
# include <concepts>
#endif
#ifdef __cpp_lib_optional_range_support // C++ >= 26
-# include <bits/formatfwd.h>
+# if _GLIBCXX_HOSTED
+# include <bits/formatfwd.h>
+# endif
# include <bits/ranges_base.h>
# include <bits/range_access.h>
#endif
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