Skip to content

Commit 23b9ac2

Browse files
committed
libstdc++: Fix <optional> for freestanding [PR125450]
libstdc++-v3/ChangeLog: PR libstdc++/125450 * include/std/optional (range_format): Do not define for freestanding.
1 parent 7239744 commit 23b9ac2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

libstdc++-v3/include/std/optional

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@
6060
# include <concepts>
6161
#endif
6262
#ifdef __cpp_lib_optional_range_support // C++ >= 26
63-
# include <bits/formatfwd.h>
63+
# if _GLIBCXX_HOSTED
64+
# include <bits/formatfwd.h>
65+
# endif
6466
# include <bits/ranges_base.h>
6567
# include <bits/range_access.h>
6668
#endif
@@ -2285,9 +2287,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
22852287
ranges::enable_borrowed_range<optional<_Tp&>> = true;
22862288
#endif
22872289

2290+
#if _GLIBCXX_HOSTED
22882291
template<typename _Tp>
22892292
inline constexpr range_format
22902293
format_kind<optional<_Tp>> = range_format::disabled;
2294+
#endif
22912295
#endif // __cpp_lib_optional_range_support
22922296

22932297
#undef _GLIBCXX_USE_CONSTRAINTS_FOR_OPTIONAL

0 commit comments

Comments
 (0)