https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125450
--- Comment #3 from Debashish Ghosh <debashish47 at gmail dot com> --- (In reply to Jonathan Wakely from comment #2) > 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 I think we need to guard # include <bits/formatfwd.h> as well since this header is not available in freestanding mode.
