aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorArsen Arsenović <arsen@aarsen.me>2022-09-19 21:54:49 +0200
committerJonathan Wakely <jwakely@redhat.com>2022-10-03 15:43:48 +0100
commit18f176d0b25591e2880bc5ef453ce0834f9e0e2a (patch)
tree922b20453d486749393bf9161b96f40125caaf33 /libstdc++-v3
parent06b3c0fad1b5fe7b72e666c336595c6324933960 (diff)
downloadgcc-18f176d0b25591e2880bc5ef453ce0834f9e0e2a.zip
gcc-18f176d0b25591e2880bc5ef453ce0834f9e0e2a.tar.gz
gcc-18f176d0b25591e2880bc5ef453ce0834f9e0e2a.tar.bz2
libstdc++: Mark headers that must be hosted as such [PR103626]
PR libstdc++/103626 - _GLIBCXX_HOSTED should respect -ffreestanding Co-authored-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/103626 * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/bits/requires_hosted.h: New header. * include/experimental/algorithm: Include <bits/requires_hosted.h>. * include/experimental/any: Likewise. * include/experimental/array: Likewise. * include/experimental/buffer: Likewise. * include/experimental/chrono: Likewise. * include/experimental/deque: Likewise. * include/experimental/executor: Likewise. * include/experimental/filesystem: Likewise. * include/experimental/forward_list: Likewise. * include/experimental/functional: Likewise. * include/experimental/internet: Likewise. * include/experimental/io_context: Likewise. * include/experimental/iterator: Likewise. * include/experimental/list: Likewise. * include/experimental/map: Likewise. * include/experimental/memory: Likewise. * include/experimental/memory_resource: Likewise. * include/experimental/net: Likewise. * include/experimental/netfwd: Likewise. * include/experimental/numeric: Likewise. * include/experimental/optional: Likewise. * include/experimental/propagate_const: Likewise. * include/experimental/random: Likewise. * include/experimental/ratio: Likewise. * include/experimental/regex: Likewise. * include/experimental/scope: Likewise. * include/experimental/set: Likewise. * include/experimental/simd: Likewise. * include/experimental/socket: Likewise. * include/experimental/source_location: Likewise. * include/experimental/string: Likewise. * include/experimental/string_view: Likewise. * include/experimental/system_error: Likewise. * include/experimental/timer: Likewise. * include/experimental/tuple: Likewise. * include/experimental/unordered_map: Likewise. * include/experimental/unordered_set: Likewise. * include/experimental/utility: Likewise. * include/experimental/vector: Likewise. * include/std/barrier: Likewise. * include/std/chrono: Likewise. * include/std/condition_variable: Likewise. * include/std/deque: Likewise. * include/std/execution: Likewise. * include/std/filesystem: Likewise. * include/std/forward_list: Likewise. * include/std/fstream: Likewise. * include/std/future: Likewise. * include/std/iomanip: Likewise. * include/std/ios: Likewise. * include/std/iosfwd: Likewise. * include/std/iostream: Likewise. * include/std/istream: Likewise. * include/std/latch: Likewise. * include/std/list: Likewise. * include/std/locale: Likewise. * include/std/map: Likewise. * include/std/memory_resource: Likewise. * include/std/mutex: Likewise. * include/std/ostream: Likewise. * include/std/queue: Likewise. * include/std/random: Likewise. * include/std/regex: Likewise. * include/std/semaphore: Likewise. * include/std/set: Likewise. * include/std/shared_mutex: Likewise. * include/std/spanstream: Likewise. * include/std/sstream: Likewise. * include/std/stack: Likewise. * include/std/stacktrace: Likewise. * include/std/stop_token: Likewise. * include/std/streambuf: Likewise. * include/std/string: Likewise. * include/std/syncstream: Likewise. * include/std/system_error: Likewise. * include/std/thread: Likewise. * include/std/unordered_map: Likewise. * include/std/unordered_set: Likewise. * include/std/valarray: Likewise. * include/std/vector: Likewise. * include/tr1/array: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/cctype: Likewise. * include/tr1/cfenv: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/cinttypes: Likewise. * include/tr1/climits: Likewise. * include/tr1/cmath: Likewise. * include/tr1/complex: Likewise. * include/tr1/complex.h: Likewise. * include/tr1/cstdarg: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cstdint: Likewise. * include/tr1/cstdio: Likewise. * include/tr1/cstdlib: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/ctime: Likewise. * include/tr1/ctype.h: Likewise. * include/tr1/cwchar: Likewise. * include/tr1/cwctype: Likewise. * include/tr1/fenv.h: Likewise. * include/tr1/float.h: Likewise. * include/tr1/functional: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/limits.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/memory: Likewise. * include/tr1/random: Likewise. * include/tr1/regex: Likewise. * include/tr1/stdarg.h: Likewise. * include/tr1/stdbool.h: Likewise. * include/tr1/stdint.h: Likewise. * include/tr1/stdio.h: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/tuple: Likewise. * include/tr1/type_traits: Likewise. * include/tr1/unordered_map: Likewise. * include/tr1/unordered_set: Likewise. * include/tr1/utility: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/wctype.h: Likewise. * include/c_global/cmath: Likewise. * include/ext/algorithm: Include <bits/requires_hosted.h>. * include/ext/bitmap_allocator.h: Likewise. * include/ext/cmath: Likewise. * include/ext/codecvt_specializations.h: Likewise. * include/ext/debug_allocator.h: Likewise. * include/ext/enc_filebuf.h: Likewise. * include/ext/extptr_allocator.h: Likewise. * include/ext/functional: Likewise. * include/ext/malloc_allocator.h: Likewise. * include/ext/memory: Likewise. * include/ext/mt_allocator.h: Likewise. * include/ext/new_allocator.h: Likewise. * include/ext/numeric: Likewise. * include/ext/pod_char_traits.h: Likewise. * include/ext/pool_allocator.h: Likewise. * include/ext/random: Likewise. * include/ext/random.tcc: Likewise. * include/ext/rb_tree: Likewise. * include/ext/rc_string_base.h: Likewise. * include/ext/rope: Likewise. * include/ext/ropeimpl.h: Likewise. * include/ext/slist: Likewise. * include/ext/sso_string_base.h: Likewise. * include/ext/stdio_filebuf.h: Likewise. * include/ext/stdio_sync_filebuf.h: Likewise. * include/ext/string_conversions.h: Likewise. * include/ext/throw_allocator.h: Likewise. * include/ext/vstring.h: Likewise. * include/ext/vstring.tcc: Likewise. * include/ext/vstring_fwd.h: Likewise. * include/ext/vstring_util.h: Likewise. * include/std/charconv: Likewise. (__cpp_lib_to_chars): Do not define for freestanding. * include/std/version: Adjust which macros get defined in freestanding. * include/ext/pointer.h [!_GLIBCXX_HOSTED]: Omit iostream functionality from freestanding. * include/std/algorithm [!_GLIBCXX_HOSTED]: Omit PSTL algos. * include/std/memory [!_GLIBCXX_HOSTED]: Omit <bits/stl_tempbuf.h> in freestanding * include/bits/algorithmfwd.h [!_GLIBCXX_HOSTED]: Omit leftover random_shuffle and stable_partition definition. * include/bits/stl_algo.h [!_GLIBCXX_HOSTED]: Omit random_shuffle and stable_partition from freestanding. * include/bits/ranges_algo.h [!_GLIBCXX_HOSTED]: Omit stable_partition from freestanding. * include/bits/concept_check.h: Remove needless HOSTED check. * include/std/iterator: Include <bits/ranges_base.h>. * include/std/numeric (__cpp_lib_parallel_algorithms): Do not define for freestanding. * include/std/functional (__cpp_lib_boyer_moore_searcher): Likewise. * testsuite/lib/prune.exp: Match error for hosted-only libstdc++ tests.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/include/Makefile.am1
-rw-r--r--libstdc++-v3/include/Makefile.in1
-rw-r--r--libstdc++-v3/include/bits/algorithmfwd.h4
-rw-r--r--libstdc++-v3/include/bits/concept_check.h2
-rw-r--r--libstdc++-v3/include/bits/ranges_algo.h2
-rw-r--r--libstdc++-v3/include/bits/requires_hosted.h37
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h2
-rw-r--r--libstdc++-v3/include/c_global/cmath2
-rw-r--r--libstdc++-v3/include/experimental/algorithm2
-rw-r--r--libstdc++-v3/include/experimental/any2
-rw-r--r--libstdc++-v3/include/experimental/array2
-rw-r--r--libstdc++-v3/include/experimental/buffer2
-rw-r--r--libstdc++-v3/include/experimental/chrono2
-rw-r--r--libstdc++-v3/include/experimental/deque2
-rw-r--r--libstdc++-v3/include/experimental/executor2
-rw-r--r--libstdc++-v3/include/experimental/filesystem2
-rw-r--r--libstdc++-v3/include/experimental/forward_list2
-rw-r--r--libstdc++-v3/include/experimental/functional2
-rw-r--r--libstdc++-v3/include/experimental/internet2
-rw-r--r--libstdc++-v3/include/experimental/io_context2
-rw-r--r--libstdc++-v3/include/experimental/iterator2
-rw-r--r--libstdc++-v3/include/experimental/list2
-rw-r--r--libstdc++-v3/include/experimental/map2
-rw-r--r--libstdc++-v3/include/experimental/memory2
-rw-r--r--libstdc++-v3/include/experimental/memory_resource2
-rw-r--r--libstdc++-v3/include/experimental/net2
-rw-r--r--libstdc++-v3/include/experimental/netfwd2
-rw-r--r--libstdc++-v3/include/experimental/numeric2
-rw-r--r--libstdc++-v3/include/experimental/optional2
-rw-r--r--libstdc++-v3/include/experimental/propagate_const2
-rw-r--r--libstdc++-v3/include/experimental/random2
-rw-r--r--libstdc++-v3/include/experimental/ratio2
-rw-r--r--libstdc++-v3/include/experimental/regex2
-rw-r--r--libstdc++-v3/include/experimental/scope2
-rw-r--r--libstdc++-v3/include/experimental/set2
-rw-r--r--libstdc++-v3/include/experimental/simd2
-rw-r--r--libstdc++-v3/include/experimental/socket2
-rw-r--r--libstdc++-v3/include/experimental/source_location2
-rw-r--r--libstdc++-v3/include/experimental/string2
-rw-r--r--libstdc++-v3/include/experimental/string_view2
-rw-r--r--libstdc++-v3/include/experimental/system_error2
-rw-r--r--libstdc++-v3/include/experimental/timer2
-rw-r--r--libstdc++-v3/include/experimental/tuple2
-rw-r--r--libstdc++-v3/include/experimental/unordered_map2
-rw-r--r--libstdc++-v3/include/experimental/unordered_set2
-rw-r--r--libstdc++-v3/include/experimental/utility2
-rw-r--r--libstdc++-v3/include/experimental/vector2
-rw-r--r--libstdc++-v3/include/ext/algorithm2
-rw-r--r--libstdc++-v3/include/ext/bitmap_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/cmath2
-rw-r--r--libstdc++-v3/include/ext/codecvt_specializations.h2
-rw-r--r--libstdc++-v3/include/ext/debug_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/enc_filebuf.h2
-rw-r--r--libstdc++-v3/include/ext/extptr_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/functional2
-rw-r--r--libstdc++-v3/include/ext/malloc_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/memory2
-rw-r--r--libstdc++-v3/include/ext/mt_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/new_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/numeric2
-rw-r--r--libstdc++-v3/include/ext/pod_char_traits.h2
-rw-r--r--libstdc++-v3/include/ext/pointer.h7
-rw-r--r--libstdc++-v3/include/ext/pool_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/random2
-rw-r--r--libstdc++-v3/include/ext/random.tcc2
-rw-r--r--libstdc++-v3/include/ext/rb_tree2
-rw-r--r--libstdc++-v3/include/ext/rc_string_base.h2
-rw-r--r--libstdc++-v3/include/ext/rope2
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h2
-rw-r--r--libstdc++-v3/include/ext/slist2
-rw-r--r--libstdc++-v3/include/ext/sso_string_base.h2
-rw-r--r--libstdc++-v3/include/ext/stdio_filebuf.h2
-rw-r--r--libstdc++-v3/include/ext/stdio_sync_filebuf.h2
-rw-r--r--libstdc++-v3/include/ext/string_conversions.h2
-rw-r--r--libstdc++-v3/include/ext/throw_allocator.h2
-rw-r--r--libstdc++-v3/include/ext/vstring.h2
-rw-r--r--libstdc++-v3/include/ext/vstring.tcc2
-rw-r--r--libstdc++-v3/include/ext/vstring_fwd.h2
-rw-r--r--libstdc++-v3/include/ext/vstring_util.h2
-rw-r--r--libstdc++-v3/include/std/algorithm4
-rw-r--r--libstdc++-v3/include/std/barrier2
-rw-r--r--libstdc++-v3/include/std/charconv4
-rw-r--r--libstdc++-v3/include/std/chrono2
-rw-r--r--libstdc++-v3/include/std/condition_variable2
-rw-r--r--libstdc++-v3/include/std/deque2
-rw-r--r--libstdc++-v3/include/std/execution2
-rw-r--r--libstdc++-v3/include/std/filesystem2
-rw-r--r--libstdc++-v3/include/std/forward_list2
-rw-r--r--libstdc++-v3/include/std/fstream2
-rw-r--r--libstdc++-v3/include/std/functional3
-rw-r--r--libstdc++-v3/include/std/future2
-rw-r--r--libstdc++-v3/include/std/iomanip2
-rw-r--r--libstdc++-v3/include/std/ios2
-rw-r--r--libstdc++-v3/include/std/iosfwd2
-rw-r--r--libstdc++-v3/include/std/iostream2
-rw-r--r--libstdc++-v3/include/std/istream2
-rw-r--r--libstdc++-v3/include/std/iterator4
-rw-r--r--libstdc++-v3/include/std/latch2
-rw-r--r--libstdc++-v3/include/std/list2
-rw-r--r--libstdc++-v3/include/std/locale2
-rw-r--r--libstdc++-v3/include/std/map2
-rw-r--r--libstdc++-v3/include/std/memory2
-rw-r--r--libstdc++-v3/include/std/memory_resource2
-rw-r--r--libstdc++-v3/include/std/mutex2
-rw-r--r--libstdc++-v3/include/std/numeric2
-rw-r--r--libstdc++-v3/include/std/ostream2
-rw-r--r--libstdc++-v3/include/std/queue2
-rw-r--r--libstdc++-v3/include/std/random2
-rw-r--r--libstdc++-v3/include/std/regex2
-rw-r--r--libstdc++-v3/include/std/semaphore2
-rw-r--r--libstdc++-v3/include/std/set2
-rw-r--r--libstdc++-v3/include/std/shared_mutex2
-rw-r--r--libstdc++-v3/include/std/spanstream2
-rw-r--r--libstdc++-v3/include/std/sstream2
-rw-r--r--libstdc++-v3/include/std/stack2
-rw-r--r--libstdc++-v3/include/std/stacktrace2
-rw-r--r--libstdc++-v3/include/std/stop_token2
-rw-r--r--libstdc++-v3/include/std/streambuf2
-rw-r--r--libstdc++-v3/include/std/string2
-rw-r--r--libstdc++-v3/include/std/syncstream2
-rw-r--r--libstdc++-v3/include/std/system_error2
-rw-r--r--libstdc++-v3/include/std/thread2
-rw-r--r--libstdc++-v3/include/std/unordered_map2
-rw-r--r--libstdc++-v3/include/std/unordered_set2
-rw-r--r--libstdc++-v3/include/std/valarray2
-rw-r--r--libstdc++-v3/include/std/vector2
-rw-r--r--libstdc++-v3/include/std/version100
-rw-r--r--libstdc++-v3/include/tr1/array2
-rw-r--r--libstdc++-v3/include/tr1/ccomplex2
-rw-r--r--libstdc++-v3/include/tr1/cctype2
-rw-r--r--libstdc++-v3/include/tr1/cfenv2
-rw-r--r--libstdc++-v3/include/tr1/cfloat2
-rw-r--r--libstdc++-v3/include/tr1/cinttypes2
-rw-r--r--libstdc++-v3/include/tr1/climits2
-rw-r--r--libstdc++-v3/include/tr1/cmath2
-rw-r--r--libstdc++-v3/include/tr1/complex2
-rw-r--r--libstdc++-v3/include/tr1/complex.h2
-rw-r--r--libstdc++-v3/include/tr1/cstdarg2
-rw-r--r--libstdc++-v3/include/tr1/cstdbool2
-rw-r--r--libstdc++-v3/include/tr1/cstdint2
-rw-r--r--libstdc++-v3/include/tr1/cstdio2
-rw-r--r--libstdc++-v3/include/tr1/cstdlib2
-rw-r--r--libstdc++-v3/include/tr1/ctgmath2
-rw-r--r--libstdc++-v3/include/tr1/ctime2
-rw-r--r--libstdc++-v3/include/tr1/ctype.h2
-rw-r--r--libstdc++-v3/include/tr1/cwchar2
-rw-r--r--libstdc++-v3/include/tr1/cwctype2
-rw-r--r--libstdc++-v3/include/tr1/fenv.h2
-rw-r--r--libstdc++-v3/include/tr1/float.h2
-rw-r--r--libstdc++-v3/include/tr1/functional2
-rw-r--r--libstdc++-v3/include/tr1/inttypes.h2
-rw-r--r--libstdc++-v3/include/tr1/limits.h2
-rw-r--r--libstdc++-v3/include/tr1/math.h2
-rw-r--r--libstdc++-v3/include/tr1/memory2
-rw-r--r--libstdc++-v3/include/tr1/random2
-rw-r--r--libstdc++-v3/include/tr1/regex2
-rw-r--r--libstdc++-v3/include/tr1/stdarg.h2
-rw-r--r--libstdc++-v3/include/tr1/stdbool.h2
-rw-r--r--libstdc++-v3/include/tr1/stdint.h2
-rw-r--r--libstdc++-v3/include/tr1/stdio.h2
-rw-r--r--libstdc++-v3/include/tr1/stdlib.h2
-rw-r--r--libstdc++-v3/include/tr1/tgmath.h2
-rw-r--r--libstdc++-v3/include/tr1/tuple2
-rw-r--r--libstdc++-v3/include/tr1/type_traits2
-rw-r--r--libstdc++-v3/include/tr1/unordered_map2
-rw-r--r--libstdc++-v3/include/tr1/unordered_set2
-rw-r--r--libstdc++-v3/include/tr1/utility2
-rw-r--r--libstdc++-v3/include/tr1/wchar.h2
-rw-r--r--libstdc++-v3/include/tr1/wctype.h2
-rw-r--r--libstdc++-v3/testsuite/lib/prune.exp4
170 files changed, 428 insertions, 59 deletions
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 3472e84..5622742 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -193,6 +193,7 @@ bits_headers = \
${bits_srcdir}/regex_compiler.tcc \
${bits_srcdir}/regex_executor.h \
${bits_srcdir}/regex_executor.tcc \
+ ${bits_srcdir}/requires_hosted.h \
${bits_srcdir}/semaphore_base.h \
${bits_srcdir}/shared_ptr.h \
${bits_srcdir}/shared_ptr_atomic.h \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 39ef34f..f6ed98f 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -551,6 +551,7 @@ bits_headers = \
${bits_srcdir}/regex_compiler.tcc \
${bits_srcdir}/regex_executor.h \
${bits_srcdir}/regex_executor.tcc \
+ ${bits_srcdir}/requires_hosted.h \
${bits_srcdir}/semaphore_base.h \
${bits_srcdir}/shared_ptr.h \
${bits_srcdir}/shared_ptr_atomic.h \
diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h
index aacc34e..0833052 100644
--- a/libstdc++-v3/include/bits/algorithmfwd.h
+++ b/libstdc++-v3/include/bits/algorithmfwd.h
@@ -638,9 +638,11 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
void
sort_heap(_RAIter, _RAIter, _Compare);
+#if _GLIBCXX_HOSTED
template<typename _BIter, typename _Predicate>
_BIter
stable_partition(_BIter, _BIter, _Predicate);
+#endif
#if __cplusplus < 201103L
// For C++11 swap() is declared in <type_traits>.
@@ -828,6 +830,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
_BIter
partition(_BIter, _BIter, _Predicate);
+#if _GLIBCXX_HOSTED
template<typename _RAIter>
void
random_shuffle(_RAIter, _RAIter);
@@ -840,6 +843,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
#else
_Generator&);
#endif
+#endif // HOSTED
template<typename _FIter, typename _Tp>
_GLIBCXX20_CONSTEXPR
diff --git a/libstdc++-v3/include/bits/concept_check.h b/libstdc++-v3/include/bits/concept_check.h
index 35969d2..32b794d 100644
--- a/libstdc++-v3/include/bits/concept_check.h
+++ b/libstdc++-v3/include/bits/concept_check.h
@@ -43,7 +43,7 @@
// configure options or editing c++config.h.
// It is not supported for freestanding implementations.
-#if !defined(_GLIBCXX_CONCEPT_CHECKS) || !_GLIBCXX_HOSTED
+#if !defined(_GLIBCXX_CONCEPT_CHECKS)
#define __glibcxx_function_requires(...)
#define __glibcxx_class_requires(_a,_b)
diff --git a/libstdc++-v3/include/bits/ranges_algo.h b/libstdc++-v3/include/bits/ranges_algo.h
index 228e10b..de71bd0 100644
--- a/libstdc++-v3/include/bits/ranges_algo.h
+++ b/libstdc++-v3/include/bits/ranges_algo.h
@@ -2326,6 +2326,7 @@ namespace ranges
inline constexpr __partition_fn partition{};
+#if _GLIBCXX_HOSTED
struct __stable_partition_fn
{
template<bidirectional_iterator _Iter, sentinel_for<_Iter> _Sent,
@@ -2356,6 +2357,7 @@ namespace ranges
};
inline constexpr __stable_partition_fn stable_partition{};
+#endif
template<typename _Iter, typename _Out1, typename _Out2>
struct in_out_out_result
diff --git a/libstdc++-v3/include/bits/requires_hosted.h b/libstdc++-v3/include/bits/requires_hosted.h
new file mode 100644
index 0000000..86916e2
--- /dev/null
+++ b/libstdc++-v3/include/bits/requires_hosted.h
@@ -0,0 +1,37 @@
+// Copyright The GNU Toolchain Authors.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/requires_hosted.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{version}
+ */
+
+#ifndef _REQUIRES_FREESTANDING_H
+#define _REQUIRES_FREESTANDING_H 1
+
+#include <bits/c++config.h>
+
+#if !_GLIBCXX_HOSTED
+# error "This header is not available in freestanding mode."
+#endif
+
+#endif
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index e63fe66..6386918 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -4594,7 +4594,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
std::iter_swap(__i, __j);
}
}
-#endif // HOSTED
/**
* @brief Shuffle the elements of a sequence using a random number
@@ -4638,6 +4637,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
std::iter_swap(__i, __j);
}
}
+#endif // HOSTED
#endif // C++11 || USE_DEPRECATED
/**
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index 1b993f3..cc14982 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -38,6 +38,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h>
+
#include <bits/c++config.h>
#include <bits/cpp_type_traits.h>
#include <ext/type_traits.h>
diff --git a/libstdc++-v3/include/experimental/algorithm b/libstdc++-v3/include/experimental/algorithm
index 5a4a022..99348cb 100644
--- a/libstdc++-v3/include/experimental/algorithm
+++ b/libstdc++-v3/include/experimental/algorithm
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <algorithm>
diff --git a/libstdc++-v3/include/experimental/any b/libstdc++-v3/include/experimental/any
index b8ff90a..b8ab5a8 100644
--- a/libstdc++-v3/include/experimental/any
+++ b/libstdc++-v3/include/experimental/any
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <typeinfo>
diff --git a/libstdc++-v3/include/experimental/array b/libstdc++-v3/include/experimental/array
index 3a064d2..f2bdd65 100644
--- a/libstdc++-v3/include/experimental/array
+++ b/libstdc++-v3/include/experimental/array
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <array>
diff --git a/libstdc++-v3/include/experimental/buffer b/libstdc++-v3/include/experimental/buffer
index 0c103e1..bc34618 100644
--- a/libstdc++-v3/include/experimental/buffer
+++ b/libstdc++-v3/include/experimental/buffer
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <array>
diff --git a/libstdc++-v3/include/experimental/chrono b/libstdc++-v3/include/experimental/chrono
index 8ec3191..417f8be 100644
--- a/libstdc++-v3/include/experimental/chrono
+++ b/libstdc++-v3/include/experimental/chrono
@@ -36,6 +36,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <bits/chrono.h> // Only the C++14 parts of <chrono>
diff --git a/libstdc++-v3/include/experimental/deque b/libstdc++-v3/include/experimental/deque
index b64deee..4f3d12d 100644
--- a/libstdc++-v3/include/experimental/deque
+++ b/libstdc++-v3/include/experimental/deque
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <deque>
diff --git a/libstdc++-v3/include/experimental/executor b/libstdc++-v3/include/experimental/executor
index bfcf217..9d0cd6e 100644
--- a/libstdc++-v3/include/experimental/executor
+++ b/libstdc++-v3/include/experimental/executor
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <algorithm>
diff --git a/libstdc++-v3/include/experimental/filesystem b/libstdc++-v3/include/experimental/filesystem
index 85872e6..7c47e6b 100644
--- a/libstdc++-v3/include/experimental/filesystem
+++ b/libstdc++-v3/include/experimental/filesystem
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201103L
#include <experimental/bits/fs_fwd.h>
diff --git a/libstdc++-v3/include/experimental/forward_list b/libstdc++-v3/include/experimental/forward_list
index fedf2ba..679b43d 100644
--- a/libstdc++-v3/include/experimental/forward_list
+++ b/libstdc++-v3/include/experimental/forward_list
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <forward_list>
diff --git a/libstdc++-v3/include/experimental/functional b/libstdc++-v3/include/experimental/functional
index 1a47b52..a0e73fa 100644
--- a/libstdc++-v3/include/experimental/functional
+++ b/libstdc++-v3/include/experimental/functional
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <functional>
diff --git a/libstdc++-v3/include/experimental/internet b/libstdc++-v3/include/experimental/internet
index 4be4bfb..6e3c355 100644
--- a/libstdc++-v3/include/experimental/internet
+++ b/libstdc++-v3/include/experimental/internet
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <experimental/netfwd>
diff --git a/libstdc++-v3/include/experimental/io_context b/libstdc++-v3/include/experimental/io_context
index 8d4fc25..cea2a86 100644
--- a/libstdc++-v3/include/experimental/io_context
+++ b/libstdc++-v3/include/experimental/io_context
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <atomic>
diff --git a/libstdc++-v3/include/experimental/iterator b/libstdc++-v3/include/experimental/iterator
index e68d09c..35ac5a6 100644
--- a/libstdc++-v3/include/experimental/iterator
+++ b/libstdc++-v3/include/experimental/iterator
@@ -36,6 +36,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <iterator>
diff --git a/libstdc++-v3/include/experimental/list b/libstdc++-v3/include/experimental/list
index 7e4ef18..7d49eef 100644
--- a/libstdc++-v3/include/experimental/list
+++ b/libstdc++-v3/include/experimental/list
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <list>
diff --git a/libstdc++-v3/include/experimental/map b/libstdc++-v3/include/experimental/map
index 4936a66..525252b 100644
--- a/libstdc++-v3/include/experimental/map
+++ b/libstdc++-v3/include/experimental/map
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <map>
diff --git a/libstdc++-v3/include/experimental/memory b/libstdc++-v3/include/experimental/memory
index 6cf11b4..fabeb58 100644
--- a/libstdc++-v3/include/experimental/memory
+++ b/libstdc++-v3/include/experimental/memory
@@ -36,6 +36,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <memory>
diff --git a/libstdc++-v3/include/experimental/memory_resource b/libstdc++-v3/include/experimental/memory_resource
index d70a932..aa86c04 100644
--- a/libstdc++-v3/include/experimental/memory_resource
+++ b/libstdc++-v3/include/experimental/memory_resource
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <memory> // align, uses_allocator, __uses_alloc
diff --git a/libstdc++-v3/include/experimental/net b/libstdc++-v3/include/experimental/net
index 9d1d5c7..1268528 100644
--- a/libstdc++-v3/include/experimental/net
+++ b/libstdc++-v3/include/experimental/net
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <experimental/executor>
diff --git a/libstdc++-v3/include/experimental/netfwd b/libstdc++-v3/include/experimental/netfwd
index 2fd6ff9..e1e0533 100644
--- a/libstdc++-v3/include/experimental/netfwd
+++ b/libstdc++-v3/include/experimental/netfwd
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
// #define __cpp_lib_experimental_net 201803
diff --git a/libstdc++-v3/include/experimental/numeric b/libstdc++-v3/include/experimental/numeric
index 426d943..26be27a 100644
--- a/libstdc++-v3/include/experimental/numeric
+++ b/libstdc++-v3/include/experimental/numeric
@@ -36,6 +36,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <numeric>
diff --git a/libstdc++-v3/include/experimental/optional b/libstdc++-v3/include/experimental/optional
index 0d3a894..c5da58a 100644
--- a/libstdc++-v3/include/experimental/optional
+++ b/libstdc++-v3/include/experimental/optional
@@ -30,6 +30,8 @@
#ifndef _GLIBCXX_EXPERIMENTAL_OPTIONAL
#define _GLIBCXX_EXPERIMENTAL_OPTIONAL 1
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <type_traits>
diff --git a/libstdc++-v3/include/experimental/propagate_const b/libstdc++-v3/include/experimental/propagate_const
index 80fcb2c..258ef6f 100644
--- a/libstdc++-v3/include/experimental/propagate_const
+++ b/libstdc++-v3/include/experimental/propagate_const
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <type_traits>
diff --git a/libstdc++-v3/include/experimental/random b/libstdc++-v3/include/experimental/random
index adef31f..8728aa3 100644
--- a/libstdc++-v3/include/experimental/random
+++ b/libstdc++-v3/include/experimental/random
@@ -30,6 +30,8 @@
#ifndef _GLIBCXX_EXPERIMENTAL_RANDOM
#define _GLIBCXX_EXPERIMENTAL_RANDOM 1
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <random>
#include <experimental/bits/lfts_config.h>
diff --git a/libstdc++-v3/include/experimental/ratio b/libstdc++-v3/include/experimental/ratio
index 59ce85e..5d873f2 100644
--- a/libstdc++-v3/include/experimental/ratio
+++ b/libstdc++-v3/include/experimental/ratio
@@ -36,6 +36,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <ratio>
diff --git a/libstdc++-v3/include/experimental/regex b/libstdc++-v3/include/experimental/regex
index 9d063c6..5efb886 100644
--- a/libstdc++-v3/include/experimental/regex
+++ b/libstdc++-v3/include/experimental/regex
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <regex>
diff --git a/libstdc++-v3/include/experimental/scope b/libstdc++-v3/include/experimental/scope
index 208fadc..5dbeac1 100644
--- a/libstdc++-v3/include/experimental/scope
+++ b/libstdc++-v3/include/experimental/scope
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 202002L
#include <concepts>
diff --git a/libstdc++-v3/include/experimental/set b/libstdc++-v3/include/experimental/set
index aa43a2b2..b42a3cd 100644
--- a/libstdc++-v3/include/experimental/set
+++ b/libstdc++-v3/include/experimental/set
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <set>
diff --git a/libstdc++-v3/include/experimental/simd b/libstdc++-v3/include/experimental/simd
index f526c70..4bd4648 100644
--- a/libstdc++-v3/include/experimental/simd
+++ b/libstdc++-v3/include/experimental/simd
@@ -33,6 +33,8 @@
#ifndef _GLIBCXX_EXPERIMENTAL_SIMD
#define _GLIBCXX_EXPERIMENTAL_SIMD
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201703L
/** @defgroup par-ts Parallelism TS
diff --git a/libstdc++-v3/include/experimental/socket b/libstdc++-v3/include/experimental/socket
index 868927a..65fe2b7 100644
--- a/libstdc++-v3/include/experimental/socket
+++ b/libstdc++-v3/include/experimental/socket
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <experimental/netfwd>
diff --git a/libstdc++-v3/include/experimental/source_location b/libstdc++-v3/include/experimental/source_location
index afd3401..acd41c0 100644
--- a/libstdc++-v3/include/experimental/source_location
+++ b/libstdc++-v3/include/experimental/source_location
@@ -30,6 +30,8 @@
#ifndef _GLIBCXX_EXPERIMENTAL_SRCLOC
#define _GLIBCXX_EXPERIMENTAL_SRCLOC 1
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <cstdint>
diff --git a/libstdc++-v3/include/experimental/string b/libstdc++-v3/include/experimental/string
index 01bd84b..f326b85 100644
--- a/libstdc++-v3/include/experimental/string
+++ b/libstdc++-v3/include/experimental/string
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <string>
diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view
index ff04bb1..f5b4cf1 100644
--- a/libstdc++-v3/include/experimental/string_view
+++ b/libstdc++-v3/include/experimental/string_view
@@ -36,6 +36,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <string>
diff --git a/libstdc++-v3/include/experimental/system_error b/libstdc++-v3/include/experimental/system_error
index 9023d44..f41cddd 100644
--- a/libstdc++-v3/include/experimental/system_error
+++ b/libstdc++-v3/include/experimental/system_error
@@ -36,6 +36,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <system_error>
diff --git a/libstdc++-v3/include/experimental/timer b/libstdc++-v3/include/experimental/timer
index 745f3a4..02498b0 100644
--- a/libstdc++-v3/include/experimental/timer
+++ b/libstdc++-v3/include/experimental/timer
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <bits/chrono.h>
diff --git a/libstdc++-v3/include/experimental/tuple b/libstdc++-v3/include/experimental/tuple
index 338f2f5..906bd7b 100644
--- a/libstdc++-v3/include/experimental/tuple
+++ b/libstdc++-v3/include/experimental/tuple
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <tuple>
diff --git a/libstdc++-v3/include/experimental/unordered_map b/libstdc++-v3/include/experimental/unordered_map
index 1a41687..ce56c2a 100644
--- a/libstdc++-v3/include/experimental/unordered_map
+++ b/libstdc++-v3/include/experimental/unordered_map
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <unordered_map>
diff --git a/libstdc++-v3/include/experimental/unordered_set b/libstdc++-v3/include/experimental/unordered_set
index 583c437..c707587 100644
--- a/libstdc++-v3/include/experimental/unordered_set
+++ b/libstdc++-v3/include/experimental/unordered_set
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <unordered_set>
diff --git a/libstdc++-v3/include/experimental/utility b/libstdc++-v3/include/experimental/utility
index 6156731..cc335e0 100644
--- a/libstdc++-v3/include/experimental/utility
+++ b/libstdc++-v3/include/experimental/utility
@@ -30,6 +30,8 @@
#ifndef _GLIBCXX_EXPERIMENTAL_UTILITY
#define _GLIBCXX_EXPERIMENTAL_UTILITY 1
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <utility>
#include <bits/uses_allocator.h>
diff --git a/libstdc++-v3/include/experimental/vector b/libstdc++-v3/include/experimental/vector
index 2b611fc..4e8c846 100644
--- a/libstdc++-v3/include/experimental/vector
+++ b/libstdc++-v3/include/experimental/vector
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
#if __cplusplus >= 201402L
#include <vector>
diff --git a/libstdc++-v3/include/ext/algorithm b/libstdc++-v3/include/ext/algorithm
index f5eced6..65122da 100644
--- a/libstdc++-v3/include/ext/algorithm
+++ b/libstdc++-v3/include/ext/algorithm
@@ -58,6 +58,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <algorithm>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h
index 033f132..80b8fa7 100644
--- a/libstdc++-v3/include/ext/bitmap_allocator.h
+++ b/libstdc++-v3/include/ext/bitmap_allocator.h
@@ -29,6 +29,8 @@
#ifndef _BITMAP_ALLOCATOR_H
#define _BITMAP_ALLOCATOR_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <utility> // For std::pair.
#include <bits/functexcept.h> // For __throw_bad_alloc().
#include <bits/stl_function.h> // For greater_equal, and less_equal.
diff --git a/libstdc++-v3/include/ext/cmath b/libstdc++-v3/include/ext/cmath
index 2291969..2ebad8b 100644
--- a/libstdc++-v3/include/ext/cmath
+++ b/libstdc++-v3/include/ext/cmath
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/ext/codecvt_specializations.h b/libstdc++-v3/include/ext/codecvt_specializations.h
index 51b638d..7f733e6 100644
--- a/libstdc++-v3/include/ext/codecvt_specializations.h
+++ b/libstdc++-v3/include/ext/codecvt_specializations.h
@@ -35,6 +35,8 @@
#ifndef _EXT_CODECVT_SPECIALIZATIONS_H
#define _EXT_CODECVT_SPECIALIZATIONS_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <bits/c++config.h>
#include <locale>
#include <iconv.h>
diff --git a/libstdc++-v3/include/ext/debug_allocator.h b/libstdc++-v3/include/ext/debug_allocator.h
index 3490dca..06c15fb 100644
--- a/libstdc++-v3/include/ext/debug_allocator.h
+++ b/libstdc++-v3/include/ext/debug_allocator.h
@@ -42,6 +42,8 @@
#ifndef _DEBUG_ALLOCATOR_H
#define _DEBUG_ALLOCATOR_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <stdexcept>
#include <bits/functexcept.h>
#include <ext/alloc_traits.h>
diff --git a/libstdc++-v3/include/ext/enc_filebuf.h b/libstdc++-v3/include/ext/enc_filebuf.h
index 12869a8..fc3d9a8 100644
--- a/libstdc++-v3/include/ext/enc_filebuf.h
+++ b/libstdc++-v3/include/ext/enc_filebuf.h
@@ -29,6 +29,8 @@
#ifndef _EXT_ENC_FILEBUF_H
#define _EXT_ENC_FILEBUF_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <fstream>
#include <locale>
#include <ext/codecvt_specializations.h>
diff --git a/libstdc++-v3/include/ext/extptr_allocator.h b/libstdc++-v3/include/ext/extptr_allocator.h
index 20f746e..ad538c7 100644
--- a/libstdc++-v3/include/ext/extptr_allocator.h
+++ b/libstdc++-v3/include/ext/extptr_allocator.h
@@ -36,6 +36,8 @@
#ifndef _EXTPTR_ALLOCATOR_H
#define _EXTPTR_ALLOCATOR_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <memory>
#include <ext/numeric_traits.h>
#include <ext/pointer.h>
diff --git a/libstdc++-v3/include/ext/functional b/libstdc++-v3/include/ext/functional
index 19cd8d5..9cf864d 100644
--- a/libstdc++-v3/include/ext/functional
+++ b/libstdc++-v3/include/ext/functional
@@ -58,6 +58,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <functional>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/ext/malloc_allocator.h b/libstdc++-v3/include/ext/malloc_allocator.h
index 82b3f0a..6323ed9 100644
--- a/libstdc++-v3/include/ext/malloc_allocator.h
+++ b/libstdc++-v3/include/ext/malloc_allocator.h
@@ -29,6 +29,8 @@
#ifndef _MALLOC_ALLOCATOR_H
#define _MALLOC_ALLOCATOR_H 1
+#include <bits/requires_hosted.h> // malloc
+
#include <cstdlib>
#include <cstddef>
#include <new>
diff --git a/libstdc++-v3/include/ext/memory b/libstdc++-v3/include/ext/memory
index 105952a..9e0082b 100644
--- a/libstdc++-v3/include/ext/memory
+++ b/libstdc++-v3/include/ext/memory
@@ -58,6 +58,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <memory>
#include <bits/stl_tempbuf.h>
diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h
index 393d6eb0a..49743e4 100644
--- a/libstdc++-v3/include/ext/mt_allocator.h
+++ b/libstdc++-v3/include/ext/mt_allocator.h
@@ -29,6 +29,8 @@
#ifndef _MT_ALLOCATOR_H
#define _MT_ALLOCATOR_H 1
+#include <bits/requires_hosted.h> // getenv
+
#include <new>
#include <cstdlib>
#include <bits/functexcept.h>
diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h
index 96e6523..db8895f 100644
--- a/libstdc++-v3/include/ext/new_allocator.h
+++ b/libstdc++-v3/include/ext/new_allocator.h
@@ -29,6 +29,8 @@
#ifndef _NEW_ALLOCATOR_H
#define _NEW_ALLOCATOR_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <bits/new_allocator.h>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/ext/numeric b/libstdc++-v3/include/ext/numeric
index 0b2c4ee..1d9f4f4 100644
--- a/libstdc++-v3/include/ext/numeric
+++ b/libstdc++-v3/include/ext/numeric
@@ -58,6 +58,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <bits/concept_check.h>
#include <numeric>
diff --git a/libstdc++-v3/include/ext/pod_char_traits.h b/libstdc++-v3/include/ext/pod_char_traits.h
index fa0f5b6..95d90f3 100644
--- a/libstdc++-v3/include/ext/pod_char_traits.h
+++ b/libstdc++-v3/include/ext/pod_char_traits.h
@@ -34,6 +34,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <string>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/ext/pointer.h b/libstdc++-v3/include/ext/pointer.h
index 04804f0..48b7684 100644
--- a/libstdc++-v3/include/ext/pointer.h
+++ b/libstdc++-v3/include/ext/pointer.h
@@ -38,7 +38,10 @@
#pragma GCC system_header
-#include <iosfwd>
+#if _GLIBCXX_HOSTED
+# include <iosfwd>
+#endif
+
#include <bits/stl_iterator_base_types.h>
#include <ext/cast.h>
#include <ext/type_traits.h>
@@ -559,11 +562,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const _Pointer_adapter<_Tp>& __rhs)
{ return !(__lhs._Tp::operator<(__rhs)); }
+#if _GLIBCXX_HOSTED
template<typename _CharT, typename _Traits, typename _StoreT>
inline std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const _Pointer_adapter<_StoreT>& __p)
{ return (__os << __p.get()); }
+#endif // HOSTED
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h
index 8d0f089..f04a88c 100644
--- a/libstdc++-v3/include/ext/pool_allocator.h
+++ b/libstdc++-v3/include/ext/pool_allocator.h
@@ -42,6 +42,8 @@
#ifndef _POOL_ALLOCATOR_H
#define _POOL_ALLOCATOR_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <bits/c++config.h>
#include <cstdlib>
#include <new>
diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random
index 50505b8..4cc0e25 100644
--- a/libstdc++-v3/include/ext/random
+++ b/libstdc++-v3/include/ext/random
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/ext/random.tcc b/libstdc++-v3/include/ext/random.tcc
index 71ceea8..7274e0d 100644
--- a/libstdc++-v3/include/ext/random.tcc
+++ b/libstdc++-v3/include/ext/random.tcc
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/ext/rb_tree b/libstdc++-v3/include/ext/rb_tree
index b61c45b..dd685fb 100644
--- a/libstdc++-v3/include/ext/rb_tree
+++ b/libstdc++-v3/include/ext/rb_tree
@@ -58,6 +58,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <bits/stl_tree.h>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h
index f196d884..21ccfc2 100644
--- a/libstdc++-v3/include/ext/rc_string_base.h
+++ b/libstdc++-v3/include/ext/rc_string_base.h
@@ -30,6 +30,8 @@
#ifndef _RC_STRING_BASE_H
#define _RC_STRING_BASE_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <ext/atomicity.h>
#include <ext/alloc_traits.h>
#include <bits/stl_iterator_base_funcs.h>
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index f8af374..a5a821e 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -45,6 +45,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <algorithm>
#include <iosfwd>
#include <bits/stl_construct.h>
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index 27cb738..fe35d91 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -1227,6 +1227,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__result = _S_concat(__forest[__i], __result);
__forest[__i]->_M_unref_nonnil();
#if !defined(__GC) && __cpp_exceptions
+
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
__forest[__i] = 0;
#endif
}
diff --git a/libstdc++-v3/include/ext/slist b/libstdc++-v3/include/ext/slist
index 7b6f882..f2b5109 100644
--- a/libstdc++-v3/include/ext/slist
+++ b/libstdc++-v3/include/ext/slist
@@ -44,6 +44,8 @@
#ifndef _SLIST
#define _SLIST 1
+#include <bits/requires_hosted.h> // std::allocator
+
#include <algorithm>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
diff --git a/libstdc++-v3/include/ext/sso_string_base.h b/libstdc++-v3/include/ext/sso_string_base.h
index f2209e7..db5dc43 100644
--- a/libstdc++-v3/include/ext/sso_string_base.h
+++ b/libstdc++-v3/include/ext/sso_string_base.h
@@ -30,6 +30,8 @@
#ifndef _SSO_STRING_BASE_H
#define _SSO_STRING_BASE_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/ext/stdio_filebuf.h b/libstdc++-v3/include/ext/stdio_filebuf.h
index 878839b..0e83e35 100644
--- a/libstdc++-v3/include/ext/stdio_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_filebuf.h
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <fstream>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/ext/stdio_sync_filebuf.h b/libstdc++-v3/include/ext/stdio_sync_filebuf.h
index 49437c9..8f51ae2 100644
--- a/libstdc++-v3/include/ext/stdio_sync_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_sync_filebuf.h
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <streambuf>
#include <cstdio>
#include <bits/c++io.h> // For __c_file
diff --git a/libstdc++-v3/include/ext/string_conversions.h b/libstdc++-v3/include/ext/string_conversions.h
index fc03974..a4648a9 100644
--- a/libstdc++-v3/include/ext/string_conversions.h
+++ b/libstdc++-v3/include/ext/string_conversions.h
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h
index 220f5f5..a1b57e7 100644
--- a/libstdc++-v3/include/ext/throw_allocator.h
+++ b/libstdc++-v3/include/ext/throw_allocator.h
@@ -46,6 +46,8 @@
#ifndef _THROW_ALLOCATOR_H
#define _THROW_ALLOCATOR_H 1
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <cmath>
#include <ctime>
#include <map>
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index 47cbabf..f0a12d6 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#if __cplusplus >= 201103L
#include <initializer_list>
#endif
diff --git a/libstdc++-v3/include/ext/vstring.tcc b/libstdc++-v3/include/ext/vstring.tcc
index 0776fdc..18e4bbb 100644
--- a/libstdc++-v3/include/ext/vstring.tcc
+++ b/libstdc++-v3/include/ext/vstring.tcc
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <bits/cxxabi_forced.h>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/ext/vstring_fwd.h b/libstdc++-v3/include/ext/vstring_fwd.h
index c787e95..121492b 100644
--- a/libstdc++-v3/include/ext/vstring_fwd.h
+++ b/libstdc++-v3/include/ext/vstring_fwd.h
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <bits/c++config.h>
#include <bits/char_traits.h>
#include <bits/allocator.h>
diff --git a/libstdc++-v3/include/ext/vstring_util.h b/libstdc++-v3/include/ext/vstring_util.h
index 713c697..4e58a71 100644
--- a/libstdc++-v3/include/ext/vstring_util.h
+++ b/libstdc++-v3/include/ext/vstring_util.h
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // GNU extensions are currently omitted
+
#include <ext/vstring_fwd.h>
#include <debug/debug.h>
#include <bits/stl_function.h> // For less
diff --git a/libstdc++-v3/include/std/algorithm b/libstdc++-v3/include/std/algorithm
index e2cfd7c..4b39bfc 100644
--- a/libstdc++-v3/include/std/algorithm
+++ b/libstdc++-v3/include/std/algorithm
@@ -63,7 +63,7 @@
# include <bits/ranges_algo.h>
#endif
-#if __cplusplus > 201402L
+#if __cplusplus > 201402L && _GLIBCXX_HOSTED
// Parallel STL algorithms
# if _PSTL_EXECUTION_POLICIES_DEFINED
// If <execution> has already been included, pull in implementations
@@ -76,7 +76,7 @@
// Feature test macro for parallel algorithms
# define __cpp_lib_parallel_algorithm 201603L
-#endif // C++17
+#endif // C++17 && HOSTED
#ifdef _GLIBCXX_PARALLEL
# include <parallel/algorithm>
diff --git a/libstdc++-v3/include/std/barrier b/libstdc++-v3/include/std/barrier
index 997e0a8..ab6dd8b 100644
--- a/libstdc++-v3/include/std/barrier
+++ b/libstdc++-v3/include/std/barrier
@@ -40,6 +40,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // threading primitive
+
#if __cplusplus > 201703L
#include <bits/atomic_base.h>
#if __cpp_lib_atomic_wait && __cpp_aligned_new
diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv
index 533320e..64d0584 100644
--- a/libstdc++-v3/include/std/charconv
+++ b/libstdc++-v3/include/std/charconv
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // for error codes
+
// As an extension we support <charconv> in C++14, but this header should not
// be included by any other library headers in C++14 mode. This ensures that
// the names defined in this header are not added to namespace std unless a
@@ -44,7 +46,7 @@
#include <ext/numeric_traits.h>
#if _GLIBCXX_FLOAT_IS_IEEE_BINARY32 && _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 \
- && __SIZE_WIDTH__ >= 32
+ && __SIZE_WIDTH__ >= 32 && _GLIBCXX_HOSTED
# define __cpp_lib_to_chars 201611L
#endif
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index 3732a40..c0c3a67 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // for <ctime> and clocks
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 06c4ff9..b885e1b 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // threading primitive
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/deque b/libstdc++-v3/include/std/deque
index abdc2e0..0b692f1 100644
--- a/libstdc++-v3/include/std/deque
+++ b/libstdc++-v3/include/std/deque
@@ -57,6 +57,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers are hosted only
+
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
diff --git a/libstdc++-v3/include/std/execution b/libstdc++-v3/include/std/execution
index e933a1a..17f62a2 100644
--- a/libstdc++-v3/include/std/execution
+++ b/libstdc++-v3/include/std/execution
@@ -27,6 +27,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // execution policies are hosted only
+
#if __cplusplus >= 201703L
# include <bits/c++config.h>
# include <pstl/glue_execution_defs.h>
diff --git a/libstdc++-v3/include/std/filesystem b/libstdc++-v3/include/std/filesystem
index dd112a2..36d71dd 100644
--- a/libstdc++-v3/include/std/filesystem
+++ b/libstdc++-v3/include/std/filesystem
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h>
+
#if __cplusplus >= 201703L
/**
diff --git a/libstdc++-v3/include/std/forward_list b/libstdc++-v3/include/std/forward_list
index fe99e5e..5d8052c 100644
--- a/libstdc++-v3/include/std/forward_list
+++ b/libstdc++-v3/include/std/forward_list
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/fstream b/libstdc++-v3/include/std/fstream
index e62a1ad..c434664 100644
--- a/libstdc++-v3/include/std/fstream
+++ b/libstdc++-v3/include/std/fstream
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <istream>
#include <ostream>
#include <bits/codecvt.h>
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 5235ef2..adf9cb1 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -1105,7 +1105,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// Searchers
-#define __cpp_lib_boyer_moore_searcher 201603L
template<typename _ForwardIterator1, typename _BinaryPredicate = equal_to<>>
class default_searcher
@@ -1138,6 +1137,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
#if _GLIBCXX_HOSTED
+#define __cpp_lib_boyer_moore_searcher 201603L
+
template<typename _Key, typename _Tp, typename _Hash, typename _Pred>
struct __boyer_moore_map_base
{
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future
index cf08c15..8c968fe 100644
--- a/libstdc++-v3/include/std/future
+++ b/libstdc++-v3/include/std/future
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // concurrency
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/iomanip b/libstdc++-v3/include/std/iomanip
index 5371681..f73519d 100644
--- a/libstdc++-v3/include/std/iomanip
+++ b/libstdc++-v3/include/std/iomanip
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <bits/c++config.h>
#include <iosfwd>
#include <bits/ios_base.h>
diff --git a/libstdc++-v3/include/std/ios b/libstdc++-v3/include/std/ios
index 50a66cd..c759986 100644
--- a/libstdc++-v3/include/std/ios
+++ b/libstdc++-v3/include/std/ios
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <iosfwd>
#include <exception> // For ios_base::failure
#include <bits/char_traits.h> // For char_traits, streamoff, streamsize, fpos
diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd
index ddf0c95..7f156f8 100644
--- a/libstdc++-v3/include/std/iosfwd
+++ b/libstdc++-v3/include/std/iosfwd
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <bits/c++config.h>
#include <bits/stringfwd.h> // For string forward declarations.
#include <bits/postypes.h>
diff --git a/libstdc++-v3/include/std/iostream b/libstdc++-v3/include/std/iostream
index d705913..685d29a 100644
--- a/libstdc++-v3/include/std/iostream
+++ b/libstdc++-v3/include/std/iostream
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <bits/c++config.h>
#include <ostream>
#include <istream>
diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream
index 416ef55..58716ce 100644
--- a/libstdc++-v3/include/std/istream
+++ b/libstdc++-v3/include/std/istream
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <ios>
#include <ostream>
diff --git a/libstdc++-v3/include/std/iterator b/libstdc++-v3/include/std/iterator
index fb2a47c..8ee8327 100644
--- a/libstdc++-v3/include/std/iterator
+++ b/libstdc++-v3/include/std/iterator
@@ -71,4 +71,8 @@
# define __cpp_lib_null_iterators 201304L
#endif
+#if __cplusplus >= 202002L
+#include <bits/ranges_base.h> // ranges::distance, ranges::next, ranges::prev
+#endif
+
#endif /* _GLIBCXX_ITERATOR */
diff --git a/libstdc++-v3/include/std/latch b/libstdc++-v3/include/std/latch
index 7ae9022..0442f09 100644
--- a/libstdc++-v3/include/std/latch
+++ b/libstdc++-v3/include/std/latch
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // concurrency
+
#if __cplusplus > 201703L
#include <bits/atomic_base.h>
diff --git a/libstdc++-v3/include/std/list b/libstdc++-v3/include/std/list
index 9151e98..ec174ed 100644
--- a/libstdc++-v3/include/std/list
+++ b/libstdc++-v3/include/std/list
@@ -57,6 +57,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers
+
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/range_access.h>
diff --git a/libstdc++-v3/include/std/locale b/libstdc++-v3/include/std/locale
index ae83586..abfed05 100644
--- a/libstdc++-v3/include/std/locale
+++ b/libstdc++-v3/include/std/locale
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // locales
+
#include <bits/localefwd.h>
#include <bits/locale_classes.h>
#include <bits/locale_facets.h>
diff --git a/libstdc++-v3/include/std/map b/libstdc++-v3/include/std/map
index ce07f29..c973a8e 100644
--- a/libstdc++-v3/include/std/map
+++ b/libstdc++-v3/include/std/map
@@ -57,6 +57,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers
+
#include <bits/stl_tree.h>
#include <bits/stl_map.h>
#include <bits/stl_multimap.h>
diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory
index 3eff121..4336724 100644
--- a/libstdc++-v3/include/std/memory
+++ b/libstdc++-v3/include/std/memory
@@ -63,10 +63,10 @@
#include <bits/memoryfwd.h>
#if _GLIBCXX_HOSTED
# include <bits/allocator.h>
+# include <bits/stl_tempbuf.h>
#endif
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
-#include <bits/stl_tempbuf.h>
#include <bits/stl_raw_storage_iter.h>
#if __cplusplus >= 201103L
diff --git a/libstdc++-v3/include/std/memory_resource b/libstdc++-v3/include/std/memory_resource
index 19c9225..323956e 100644
--- a/libstdc++-v3/include/std/memory_resource
+++ b/libstdc++-v3/include/std/memory_resource
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // polymorphic allocation
+
#if __cplusplus >= 201703L
#include <bits/memory_resource.h>
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index b9590bb..b310c15 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // concurrency
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric
index 60a99d1..0f1f26c 100644
--- a/libstdc++-v3/include/std/numeric
+++ b/libstdc++-v3/include/std/numeric
@@ -729,7 +729,7 @@ namespace __detail
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#if __cplusplus >= 201703L
+#if __cplusplus >= 201703L && _GLIBCXX_HOSTED
// Parallel STL algorithms
# if _PSTL_EXECUTION_POLICIES_DEFINED
// If <execution> has already been included, pull in implementations
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream
index 291ea40..674decf 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <ios>
#include <bits/ostream_insert.h>
diff --git a/libstdc++-v3/include/std/queue b/libstdc++-v3/include/std/queue
index db81ef1..7c4952f 100644
--- a/libstdc++-v3/include/std/queue
+++ b/libstdc++-v3/include/std/queue
@@ -57,6 +57,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers
+
#include <deque>
#include <vector>
#include <bits/stl_heap.h>
diff --git a/libstdc++-v3/include/std/random b/libstdc++-v3/include/std/random
index 89a2f16..66757f7 100644
--- a/libstdc++-v3/include/std/random
+++ b/libstdc++-v3/include/std/random
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // OS-dependent random
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/regex b/libstdc++-v3/include/std/regex
index 491bced..aa50c7e 100644
--- a/libstdc++-v3/include/std/regex
+++ b/libstdc++-v3/include/std/regex
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // string and container heavy
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/semaphore b/libstdc++-v3/include/std/semaphore
index 8a31c6d..72d68dd 100644
--- a/libstdc++-v3/include/std/semaphore
+++ b/libstdc++-v3/include/std/semaphore
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // concurrency
+
#if __cplusplus > 201703L
#include <bits/semaphore_base.h>
diff --git a/libstdc++-v3/include/std/set b/libstdc++-v3/include/std/set
index 551c777..4cbcba1 100644
--- a/libstdc++-v3/include/std/set
+++ b/libstdc++-v3/include/std/set
@@ -57,6 +57,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers
+
#include <bits/stl_tree.h>
#include <bits/stl_set.h>
#include <bits/stl_multiset.h>
diff --git a/libstdc++-v3/include/std/shared_mutex b/libstdc++-v3/include/std/shared_mutex
index 817a958..cf74b32 100644
--- a/libstdc++-v3/include/std/shared_mutex
+++ b/libstdc++-v3/include/std/shared_mutex
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // concurrency
+
#if __cplusplus >= 201402L
#include <bits/chrono.h>
diff --git a/libstdc++-v3/include/std/spanstream b/libstdc++-v3/include/std/spanstream
index 5855b28..6abf013 100644
--- a/libstdc++-v3/include/std/spanstream
+++ b/libstdc++-v3/include/std/spanstream
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#if __cplusplus > 202002L
#include <span>
#include <streambuf>
diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream
index bc7d636..7305bdb 100644
--- a/libstdc++-v3/include/std/sstream
+++ b/libstdc++-v3/include/std/sstream
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostream
+
#include <istream>
#include <ostream>
#include <bits/alloc_traits.h> // allocator_traits, __allocator_like
diff --git a/libstdc++-v3/include/std/stack b/libstdc++-v3/include/std/stack
index fc14e2e..98d2123 100644
--- a/libstdc++-v3/include/std/stack
+++ b/libstdc++-v3/include/std/stack
@@ -57,6 +57,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers
+
#include <deque>
#include <bits/stl_stack.h>
diff --git a/libstdc++-v3/include/std/stacktrace b/libstdc++-v3/include/std/stacktrace
index 39472d7..e7cbbee 100644
--- a/libstdc++-v3/include/std/stacktrace
+++ b/libstdc++-v3/include/std/stacktrace
@@ -26,6 +26,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // std::string bound
+
#include <bits/c++config.h>
#if __cplusplus > 202002L && _GLIBCXX_HAVE_STACKTRACE
diff --git a/libstdc++-v3/include/std/stop_token b/libstdc++-v3/include/std/stop_token
index 07d4fda..f196834 100644
--- a/libstdc++-v3/include/std/stop_token
+++ b/libstdc++-v3/include/std/stop_token
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_STOP_TOKEN
#define _GLIBCXX_STOP_TOKEN
+#include <bits/requires_hosted.h> // concurrency
+
#if __cplusplus > 201703L
#include <atomic>
diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf
index 888611d..d8893df 100644
--- a/libstdc++-v3/include/std/streambuf
+++ b/libstdc++-v3/include/std/streambuf
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <bits/c++config.h>
#include <iosfwd>
#include <bits/localefwd.h>
diff --git a/libstdc++-v3/include/std/string b/libstdc++-v3/include/std/string
index 62ecdb3..41e6e2c 100644
--- a/libstdc++-v3/include/std/string
+++ b/libstdc++-v3/include/std/string
@@ -35,6 +35,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers
+
#include <bits/c++config.h>
#include <bits/stringfwd.h>
#include <bits/char_traits.h>
diff --git a/libstdc++-v3/include/std/syncstream b/libstdc++-v3/include/std/syncstream
index 7a4f731..838cec5 100644
--- a/libstdc++-v3/include/std/syncstream
+++ b/libstdc++-v3/include/std/syncstream
@@ -38,6 +38,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // iostreams
+
#include <sstream>
#include <bits/alloc_traits.h>
diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error
index e12bb2f..6dad75d 100644
--- a/libstdc++-v3/include/std/system_error
+++ b/libstdc++-v3/include/std/system_error
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // OS-dependent
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread
index 82f191a..a314b9e 100644
--- a/libstdc++-v3/include/std/thread
+++ b/libstdc++-v3/include/std/thread
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // concurrency
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/unordered_map b/libstdc++-v3/include/std/unordered_map
index b50ec2a..323edcd 100644
--- a/libstdc++-v3/include/std/unordered_map
+++ b/libstdc++-v3/include/std/unordered_map
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // container
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/unordered_set b/libstdc++-v3/include/std/unordered_set
index edaa517..998417f 100644
--- a/libstdc++-v3/include/std/unordered_set
+++ b/libstdc++-v3/include/std/unordered_set
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // containers
+
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else
diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray
index 87fec2b..90bbed7 100644
--- a/libstdc++-v3/include/std/valarray
+++ b/libstdc++-v3/include/std/valarray
@@ -33,6 +33,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // <cmath> dependant
+
#include <bits/c++config.h>
#include <cmath>
#include <algorithm>
diff --git a/libstdc++-v3/include/std/vector b/libstdc++-v3/include/std/vector
index d7f69fd..75377d5 100644
--- a/libstdc++-v3/include/std/vector
+++ b/libstdc++-v3/include/std/vector
@@ -57,6 +57,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // container
+
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index 3fd5182..397a4aa 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -46,11 +46,11 @@
#if __cplusplus >= 201103L
// c++11
+#define __cpp_lib_allocator_traits_is_always_equal 201411L
#define __cpp_lib_is_null_pointer 201309L
#define __cpp_lib_result_of_sfinae 201210L
#if _GLIBCXX_HOSTED
-# define __cpp_lib_allocator_traits_is_always_equal 201411L
#if __cplusplus <= 201703L // N.B. updated value in C++20
# define __cpp_lib_shared_ptr_arrays 201611L
#endif
@@ -73,35 +73,38 @@
#if __cpp_impl_coroutine
# define __cpp_lib_coroutine 201902L
#endif
+#define __cpp_lib_exchange_function 201304L
+#define __cpp_lib_integer_sequence 201304L
#define __cpp_lib_integral_constant_callable 201304L
#define __cpp_lib_is_final 201402L
+#define __cpp_lib_make_reverse_iterator 201402L
+#ifndef _GLIBCXX_DEBUG // PR libstdc++/70303
+# define __cpp_lib_null_iterators 201304L
+#endif
#define __cpp_lib_transformation_trait_aliases 201304L
+#define __cpp_lib_transparent_operators 201510L
+#define __cpp_lib_tuple_element_t 201402L
+#define __cpp_lib_tuples_by_type 201304L
#if _GLIBCXX_HOSTED
# define __cpp_lib_chrono_udls 201304L
# define __cpp_lib_complex_udls 201309L
-# define __cpp_lib_exchange_function 201304L
# define __cpp_lib_generic_associative_lookup 201304L
-# define __cpp_lib_integer_sequence 201304L
-# define __cpp_lib_make_reverse_iterator 201402L
# define __cpp_lib_make_unique 201304L
-# ifndef _GLIBCXX_DEBUG // PR libstdc++/70303
-# define __cpp_lib_null_iterators 201304L
-# endif
# define __cpp_lib_quoted_string_io 201304L
# define __cpp_lib_robust_nonmodifying_seq_ops 201304L
# ifdef _GLIBCXX_HAS_GTHREADS
# define __cpp_lib_shared_timed_mutex 201402L
# endif
# define __cpp_lib_string_udls 201304L
-# define __cpp_lib_transparent_operators 201510L
-# define __cpp_lib_tuple_element_t 201402L
-# define __cpp_lib_tuples_by_type 201304L
#endif
#if __cplusplus >= 201703L
// c++17
#define __cpp_lib_addressof_constexpr 201603L
+#define __cpp_lib_any 201606L
+#define __cpp_lib_apply 201603L
+#define __cpp_lib_as_const 201510L
#define __cpp_lib_atomic_is_always_lock_free 201603L
#define __cpp_lib_bool_constant 201505L
#define __cpp_lib_byte 201603L
@@ -111,6 +114,7 @@
#ifdef __GCC_DESTRUCTIVE_SIZE
# define __cpp_lib_hardware_interference_size 201703L
#endif
+#define __cpp_lib_invoke 201411L
#ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
# define __cpp_lib_is_aggregate 201703L
#endif
@@ -120,17 +124,23 @@
# define __cpp_lib_launder 201606L
#endif
#define __cpp_lib_logical_traits 201510L
+#define __cpp_lib_make_from_tuple 201606L
+#define __cpp_lib_not_fn 201603L
+#if __cplusplus == 201703L // N.B. updated value in C++20
+# define __cpp_lib_optional 201606L
+#endif
#define __cpp_lib_type_trait_variable_templates 201510L
#define __cpp_lib_uncaught_exceptions 201411L
+#if !(__cpp_concepts >= 202002L && __cpp_constexpr >= 201811L)
+// N.B. updated value in C++20
+# define __cpp_lib_variant 202102L
+#endif
#define __cpp_lib_void_t 201411L
#if _GLIBCXX_HOSTED
-#define __cpp_lib_any 201606L
-#define __cpp_lib_apply 201603L
#if __cplusplus == 201703L // N.B. updated value in C++20
# define __cpp_lib_array_constexpr 201803L
#endif
-#define __cpp_lib_as_const 201510L
#define __cpp_lib_boyer_moore_searcher 201603L
#define __cpp_lib_chrono 201611L
#define __cpp_lib_clamp 201603L
@@ -146,9 +156,7 @@
#define __cpp_lib_gcd 201606L
#define __cpp_lib_gcd_lcm 201606L
#define __cpp_lib_hypot 201603L
-#define __cpp_lib_invoke 201411L
#define __cpp_lib_lcm 201606L
-#define __cpp_lib_make_from_tuple 201606L
#define __cpp_lib_map_try_emplace 201411L
#define __cpp_lib_math_special_functions 201603L
#ifdef _GLIBCXX_HAS_GTHREADS
@@ -158,10 +166,6 @@
#endif
#define __cpp_lib_node_extract 201606L
#define __cpp_lib_nonmember_container_access 201411L
-#define __cpp_lib_not_fn 201603L
-#if __cplusplus == 201703L // N.B. updated value in C++20
-# define __cpp_lib_optional 201606L
-#endif
#define __cpp_lib_parallel_algorithm 201603L
#define __cpp_lib_raw_memory_algorithms 201606L
#define __cpp_lib_sample 201603L
@@ -176,18 +180,16 @@
# define __cpp_lib_to_chars 201611L
#endif
#define __cpp_lib_unordered_map_try_emplace 201411L
-#if !(__cpp_concepts >= 202002L && __cpp_constexpr >= 201811L)
-// N.B. updated value in C++20
-# define __cpp_lib_variant 202102L
-#endif
#endif
#if __cplusplus >= 202002L
// c++20
+#define __cpp_lib_assume_aligned 201811L
#define __cpp_lib_atomic_flag_test 201907L
#define __cpp_lib_atomic_float 201711L
#define __cpp_lib_atomic_ref 201806L
#define __cpp_lib_atomic_value_initialization 201911L
+#define __cpp_lib_bind_front 201907L
#if __has_builtin(__builtin_bit_cast)
# define __cpp_lib_bit_cast 201806L
#endif
@@ -202,6 +204,7 @@
#endif
#define __cpp_lib_endian 201907L
#define __cpp_lib_int_pow2 202002L
+#define __cpp_lib_integer_comparison_functions 202002L
#ifdef _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
# define __cpp_lib_is_constant_evaluated 201811L
#endif
@@ -214,19 +217,32 @@
&& __has_builtin(__builtin_is_pointer_interconvertible_with_class)
# define __cpp_lib_is_pointer_interconvertible 201907L
#endif
+#define __cpp_lib_math_constants 201907L
+#if __cpp_lib_concepts
+# define __cpp_lib_make_obj_using_allocator 201811L
+#endif
+#define __cpp_lib_optional 202106L
#define __cpp_lib_remove_cvref 201711L
#if __has_builtin(__builtin_source_location)
# define __cpp_lib_source_location 201907L
#endif
+#if __cpp_lib_concepts
+# define __cpp_lib_span 202002L
+#endif
+#define __cpp_lib_ssize 201902L
#if __cpp_impl_three_way_comparison >= 201907L && __cpp_lib_concepts
# define __cpp_lib_three_way_comparison 201907L
#endif
+#define __cpp_lib_to_address 201711L
+#define __cpp_lib_to_array 201907L
#define __cpp_lib_type_identity 201806L
#define __cpp_lib_unwrap_ref 201811L
+#if __cpp_concepts >= 202002L && __cpp_constexpr >= 201811L
+# define __cpp_lib_variant 202106L
+#endif
#if _GLIBCXX_HOSTED
#define __cpp_lib_array_constexpr 201811L
-#define __cpp_lib_assume_aligned 201811L
#define __cpp_lib_atomic_shared_ptr 201711L
#if defined _GLIBCXX_HAS_GTHREADS || defined _GLIBCXX_HAVE_LINUX_FUTEX
# define __cpp_lib_atomic_wait 201907L
@@ -234,9 +250,7 @@
# define __cpp_lib_barrier 201907L
# endif
#endif
-#define __cpp_lib_bind_front 201907L
// FIXME: #define __cpp_lib_execution 201902L
-#define __cpp_lib_integer_comparison_functions 202002L
#define __cpp_lib_constexpr_algorithms 201806L
#ifdef __cpp_lib_is_constant_evaluated
# define __cpp_lib_constexpr_char_traits 201811L
@@ -268,11 +282,6 @@
# define __cpp_lib_latch 201907L
#endif
#define __cpp_lib_list_remove_return_type 201806L
-#if __cpp_lib_concepts
-# define __cpp_lib_make_obj_using_allocator 201811L
-#endif
-#define __cpp_lib_math_constants 201907L
-#define __cpp_lib_optional 202106L
#define __cpp_lib_polymorphic_allocator 201902L
#if __cpp_lib_concepts
# define __cpp_lib_ranges 202110L
@@ -283,28 +292,29 @@
#define __cpp_lib_shared_ptr_arrays 201707L
#define __cpp_lib_shift 201806L
#define __cpp_lib_smart_ptr_for_overwrite 202002L
-#if __cpp_lib_concepts
-# define __cpp_lib_span 202002L
-#endif
-#define __cpp_lib_ssize 201902L
#define __cpp_lib_starts_ends_with 201711L
# if _GLIBCXX_USE_CXX11_ABI
// Only supported with cxx11-abi
# define __cpp_lib_syncbuf 201803L
# endif
-#define __cpp_lib_to_address 201711L
-#define __cpp_lib_to_array 201907L
-#if __cpp_concepts >= 202002L && __cpp_constexpr >= 201811L
-# define __cpp_lib_variant 202106L
-#endif
#endif
#if __cplusplus > 202002L
// c++23
#define __cpp_lib_byteswap 202110L
#define __cpp_lib_constexpr_typeinfo 202106L
+#if __cpp_concepts >= 202002L
+# define __cpp_lib_expected 202202L
+#endif
+#define __cpp_lib_invoke_r 202106L
#define __cpp_lib_is_scoped_enum 202011L
+#if __cpp_lib_concepts
+# undef __cpp_lib_optional
+# define __cpp_lib_optional 202110L
+#endif
#define __cpp_lib_reference_from_temporary 202202L
+#define __cpp_lib_to_underlying 202102L
+#define __cpp_lib_unreachable 202202L
#if _GLIBCXX_HOSTED
#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
@@ -313,15 +323,7 @@
# undef __cpp_lib_constexpr_memory
# define __cpp_lib_constexpr_memory 202202L
#endif
-#if __cpp_concepts >= 202002L
-# define __cpp_lib_expected 202202L
-#endif
-#define __cpp_lib_invoke_r 202106L
#define __cpp_lib_ios_noreplace 202207L
-#if __cpp_lib_concepts
-# undef __cpp_lib_optional
-# define __cpp_lib_optional 202110L
-#endif
#define __cpp_lib_move_only_function 202110L
#if __cpp_lib_span
# define __cpp_lib_spanstream 202106L
@@ -334,8 +336,6 @@
#if _GLIBCXX_USE_CXX11_ABI // Only supported with cxx11-abi
# define __cpp_lib_string_resize_and_overwrite 202110L
#endif
-#define __cpp_lib_to_underlying 202102L
-#define __cpp_lib_unreachable 202202L
#endif
#endif // C++23
#endif // C++20
diff --git a/libstdc++-v3/include/tr1/array b/libstdc++-v3/include/tr1/array
index 2aac0ed..f03ad81 100644
--- a/libstdc++-v3/include/tr1/array
+++ b/libstdc++-v3/include/tr1/array
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <bits/stl_algobase.h>
namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/tr1/ccomplex b/libstdc++-v3/include/tr1/ccomplex
index 8f9546e..1b632be 100644
--- a/libstdc++-v3/include/tr1/ccomplex
+++ b/libstdc++-v3/include/tr1/ccomplex
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_CCOMPLEX
#define _GLIBCXX_TR1_CCOMPLEX 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/complex>
#endif // _GLIBCXX_TR1_CCOMPLEX
diff --git a/libstdc++-v3/include/tr1/cctype b/libstdc++-v3/include/tr1/cctype
index 43520c7..2c4a15b 100644
--- a/libstdc++-v3/include/tr1/cctype
+++ b/libstdc++-v3/include/tr1/cctype
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_CCTYPE
#define _GLIBCXX_TR1_CCTYPE 1
+#include <bits/requires_hosted.h> // TR1
+
#include <bits/c++config.h>
#include <cctype>
diff --git a/libstdc++-v3/include/tr1/cfenv b/libstdc++-v3/include/tr1/cfenv
index 202fe27..37e06c6 100644
--- a/libstdc++-v3/include/tr1/cfenv
+++ b/libstdc++-v3/include/tr1/cfenv
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <bits/c++config.h>
#if _GLIBCXX_HAVE_FENV_H
diff --git a/libstdc++-v3/include/tr1/cfloat b/libstdc++-v3/include/tr1/cfloat
index 2456513..76bfcfb 100644
--- a/libstdc++-v3/include/tr1/cfloat
+++ b/libstdc++-v3/include/tr1/cfloat
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_CFLOAT
#define _GLIBCXX_TR1_CFLOAT 1
+#include <bits/requires_hosted.h> // TR1
+
#include <cfloat>
#ifndef DECIMAL_DIG
diff --git a/libstdc++-v3/include/tr1/cinttypes b/libstdc++-v3/include/tr1/cinttypes
index a04cf24..24b4648 100644
--- a/libstdc++-v3/include/tr1/cinttypes
+++ b/libstdc++-v3/include/tr1/cinttypes
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cstdint>
// For 8.11.1/1 (see C99, Note 184)
diff --git a/libstdc++-v3/include/tr1/climits b/libstdc++-v3/include/tr1/climits
index 95e3bc3..0d702dc 100644
--- a/libstdc++-v3/include/tr1/climits
+++ b/libstdc++-v3/include/tr1/climits
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_CLIMITS
#define _GLIBCXX_TR1_CLIMITS 1
+#include <bits/requires_hosted.h> // TR1
+
#include <climits>
#ifndef LLONG_MIN
diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath
index f3a53f3..384f116 100644
--- a/libstdc++-v3/include/tr1/cmath
+++ b/libstdc++-v3/include/tr1/cmath
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <cmath>
#ifdef _GLIBCXX_USE_C99_MATH_TR1
diff --git a/libstdc++-v3/include/tr1/complex b/libstdc++-v3/include/tr1/complex
index abb5e13..fa88cd5 100644
--- a/libstdc++-v3/include/tr1/complex
+++ b/libstdc++-v3/include/tr1/complex
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <complex>
namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/tr1/complex.h b/libstdc++-v3/include/tr1/complex.h
index f282478..c5fb4c1 100644
--- a/libstdc++-v3/include/tr1/complex.h
+++ b/libstdc++-v3/include/tr1/complex.h
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_COMPLEX_H
#define _GLIBCXX_TR1_COMPLEX_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/ccomplex>
#endif // _GLIBCXX_TR1_COMPLEX_H
diff --git a/libstdc++-v3/include/tr1/cstdarg b/libstdc++-v3/include/tr1/cstdarg
index f28ff2a..f046e816 100644
--- a/libstdc++-v3/include/tr1/cstdarg
+++ b/libstdc++-v3/include/tr1/cstdarg
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_CSTDARG
#define _GLIBCXX_TR1_CSTDARG 1
+#include <bits/requires_hosted.h> // TR1
+
#include <cstdarg>
#endif // _GLIBCXX_TR1_CSTDARG
diff --git a/libstdc++-v3/include/tr1/cstdbool b/libstdc++-v3/include/tr1/cstdbool
index 77c0315..20afb63 100644
--- a/libstdc++-v3/include/tr1/cstdbool
+++ b/libstdc++-v3/include/tr1/cstdbool
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <bits/c++config.h>
#if _GLIBCXX_HAVE_STDBOOL_H
diff --git a/libstdc++-v3/include/tr1/cstdint b/libstdc++-v3/include/tr1/cstdint
index 0d13b30..9e3e45c 100644
--- a/libstdc++-v3/include/tr1/cstdint
+++ b/libstdc++-v3/include/tr1/cstdint
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <bits/c++config.h>
// For 8.22.1/1 (see C99, Notes 219, 220, 222)
diff --git a/libstdc++-v3/include/tr1/cstdio b/libstdc++-v3/include/tr1/cstdio
index 4692d21..dcbff6a 100644
--- a/libstdc++-v3/include/tr1/cstdio
+++ b/libstdc++-v3/include/tr1/cstdio
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <cstdio>
#if _GLIBCXX_USE_C99_STDIO
diff --git a/libstdc++-v3/include/tr1/cstdlib b/libstdc++-v3/include/tr1/cstdlib
index de952bb..5569b0d 100644
--- a/libstdc++-v3/include/tr1/cstdlib
+++ b/libstdc++-v3/include/tr1/cstdlib
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <cstdlib>
#if _GLIBCXX_HOSTED
diff --git a/libstdc++-v3/include/tr1/ctgmath b/libstdc++-v3/include/tr1/ctgmath
index 64ef405..15ada9c 100644
--- a/libstdc++-v3/include/tr1/ctgmath
+++ b/libstdc++-v3/include/tr1/ctgmath
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_CTGMATH
#define _GLIBCXX_TR1_CTGMATH 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cmath>
#endif // _GLIBCXX_TR1_CTGMATH
diff --git a/libstdc++-v3/include/tr1/ctime b/libstdc++-v3/include/tr1/ctime
index 8b9b869..99b529a 100644
--- a/libstdc++-v3/include/tr1/ctime
+++ b/libstdc++-v3/include/tr1/ctime
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_CTIME
#define _GLIBCXX_TR1_CTIME 1
+#include <bits/requires_hosted.h> // TR1
+
#include <ctime>
#endif // _GLIBCXX_TR1_CTIME
diff --git a/libstdc++-v3/include/tr1/ctype.h b/libstdc++-v3/include/tr1/ctype.h
index 91177ff..014fc2b 100644
--- a/libstdc++-v3/include/tr1/ctype.h
+++ b/libstdc++-v3/include/tr1/ctype.h
@@ -29,6 +29,8 @@
#ifndef _TR1_CTYPE_H
#define _TR1_CTYPE_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cctype>
#endif
diff --git a/libstdc++-v3/include/tr1/cwchar b/libstdc++-v3/include/tr1/cwchar
index 23219bc..1140eda 100644
--- a/libstdc++-v3/include/tr1/cwchar
+++ b/libstdc++-v3/include/tr1/cwchar
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <cwchar>
#ifdef _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/include/tr1/cwctype b/libstdc++-v3/include/tr1/cwctype
index 1a71dd0..ddb25af 100644
--- a/libstdc++-v3/include/tr1/cwctype
+++ b/libstdc++-v3/include/tr1/cwctype
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <cwctype>
#ifdef _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/include/tr1/fenv.h b/libstdc++-v3/include/tr1/fenv.h
index 091b0b8..2547f00 100644
--- a/libstdc++-v3/include/tr1/fenv.h
+++ b/libstdc++-v3/include/tr1/fenv.h
@@ -29,6 +29,8 @@
#ifndef _TR1_FENV_H
#define _TR1_FENV_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cfenv>
#endif
diff --git a/libstdc++-v3/include/tr1/float.h b/libstdc++-v3/include/tr1/float.h
index 2367078..1dd3ef13 100644
--- a/libstdc++-v3/include/tr1/float.h
+++ b/libstdc++-v3/include/tr1/float.h
@@ -29,6 +29,8 @@
#ifndef _TR1_FLOAT_H
#define _TR1_FLOAT_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cfloat>
#endif
diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional
index 83d22be..ae219ab 100644
--- a/libstdc++-v3/include/tr1/functional
+++ b/libstdc++-v3/include/tr1/functional
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <functional> // for std::_Placeholder, std::_Bind, std::_Bind_result
#include <typeinfo>
diff --git a/libstdc++-v3/include/tr1/inttypes.h b/libstdc++-v3/include/tr1/inttypes.h
index 22a7514..eb5ddbe 100644
--- a/libstdc++-v3/include/tr1/inttypes.h
+++ b/libstdc++-v3/include/tr1/inttypes.h
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_INTTYPES_H
#define _GLIBCXX_TR1_INTTYPES_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cinttypes>
#endif // _GLIBCXX_TR1_INTTYPES_H
diff --git a/libstdc++-v3/include/tr1/limits.h b/libstdc++-v3/include/tr1/limits.h
index b54f9d2..73baf85 100644
--- a/libstdc++-v3/include/tr1/limits.h
+++ b/libstdc++-v3/include/tr1/limits.h
@@ -29,6 +29,8 @@
#ifndef _TR1_LIMITS_H
#define _TR1_LIMITS_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/climits>
#endif
diff --git a/libstdc++-v3/include/tr1/math.h b/libstdc++-v3/include/tr1/math.h
index 423b5ea..99c8f45 100644
--- a/libstdc++-v3/include/tr1/math.h
+++ b/libstdc++-v3/include/tr1/math.h
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_MATH_H
#define _GLIBCXX_TR1_MATH_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cmath>
#if _GLIBCXX_USE_C99_MATH_TR1
diff --git a/libstdc++-v3/include/tr1/memory b/libstdc++-v3/include/tr1/memory
index b50a558..759000b 100644
--- a/libstdc++-v3/include/tr1/memory
+++ b/libstdc++-v3/include/tr1/memory
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#if defined(_GLIBCXX_INCLUDE_AS_CXX11)
# error TR1 header cannot be included from C++11 header
#endif
diff --git a/libstdc++-v3/include/tr1/random b/libstdc++-v3/include/tr1/random
index cb57540..f9fbd4d 100644
--- a/libstdc++-v3/include/tr1/random
+++ b/libstdc++-v3/include/tr1/random
@@ -32,6 +32,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <cmath>
#include <cstdio>
#include <cstdlib>
diff --git a/libstdc++-v3/include/tr1/regex b/libstdc++-v3/include/tr1/regex
index 10db372..bcdea9d 100644
--- a/libstdc++-v3/include/tr1/regex
+++ b/libstdc++-v3/include/tr1/regex
@@ -33,6 +33,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <algorithm>
#include <bitset>
#include <iterator>
diff --git a/libstdc++-v3/include/tr1/stdarg.h b/libstdc++-v3/include/tr1/stdarg.h
index 446dda1..4622f33 100644
--- a/libstdc++-v3/include/tr1/stdarg.h
+++ b/libstdc++-v3/include/tr1/stdarg.h
@@ -29,6 +29,8 @@
#ifndef _TR1_STDARG_H
#define _TR1_STDARG_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cstdarg>
#endif
diff --git a/libstdc++-v3/include/tr1/stdbool.h b/libstdc++-v3/include/tr1/stdbool.h
index 76d0b72..368e891 100644
--- a/libstdc++-v3/include/tr1/stdbool.h
+++ b/libstdc++-v3/include/tr1/stdbool.h
@@ -29,6 +29,8 @@
#ifndef _TR1_STDBOOL_H
#define _TR1_STDBOOL_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cstdbool>
#endif
diff --git a/libstdc++-v3/include/tr1/stdint.h b/libstdc++-v3/include/tr1/stdint.h
index 59c1d95..b19361b 100644
--- a/libstdc++-v3/include/tr1/stdint.h
+++ b/libstdc++-v3/include/tr1/stdint.h
@@ -29,6 +29,8 @@
#ifndef _TR1_STDINT_H
#define _TR1_STDINT_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cstdint>
#endif
diff --git a/libstdc++-v3/include/tr1/stdio.h b/libstdc++-v3/include/tr1/stdio.h
index f7cc5c7..3ef65f9 100644
--- a/libstdc++-v3/include/tr1/stdio.h
+++ b/libstdc++-v3/include/tr1/stdio.h
@@ -29,6 +29,8 @@
#ifndef _TR1_STDIO_H
#define _TR1_STDIO_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cstdio>
#endif
diff --git a/libstdc++-v3/include/tr1/stdlib.h b/libstdc++-v3/include/tr1/stdlib.h
index 0e9c605..0963136 100644
--- a/libstdc++-v3/include/tr1/stdlib.h
+++ b/libstdc++-v3/include/tr1/stdlib.h
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_STDLIB_H
#define _GLIBCXX_TR1_STDLIB_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cstdlib>
#if _GLIBCXX_HOSTED
diff --git a/libstdc++-v3/include/tr1/tgmath.h b/libstdc++-v3/include/tr1/tgmath.h
index 3871c3c..a3505c9 100644
--- a/libstdc++-v3/include/tr1/tgmath.h
+++ b/libstdc++-v3/include/tr1/tgmath.h
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_TGMATH_H
#define _GLIBCXX_TR1_TGMATH_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/ctgmath>
#endif // _GLIBCXX_TR1_TGMATH_H
diff --git a/libstdc++-v3/include/tr1/tuple b/libstdc++-v3/include/tr1/tuple
index 94b1c0d..a24da25 100644
--- a/libstdc++-v3/include/tr1/tuple
+++ b/libstdc++-v3/include/tr1/tuple
@@ -34,6 +34,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <utility>
namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits
index 2ee3b06..305a0d0 100644
--- a/libstdc++-v3/include/tr1/type_traits
+++ b/libstdc++-v3/include/tr1/type_traits
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <bits/c++config.h>
namespace std _GLIBCXX_VISIBILITY(default)
diff --git a/libstdc++-v3/include/tr1/unordered_map b/libstdc++-v3/include/tr1/unordered_map
index edec4e2..24d3892 100644
--- a/libstdc++-v3/include/tr1/unordered_map
+++ b/libstdc++-v3/include/tr1/unordered_map
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <utility>
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
diff --git a/libstdc++-v3/include/tr1/unordered_set b/libstdc++-v3/include/tr1/unordered_set
index fa11b16..59f0ab9 100644
--- a/libstdc++-v3/include/tr1/unordered_set
+++ b/libstdc++-v3/include/tr1/unordered_set
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <utility>
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
diff --git a/libstdc++-v3/include/tr1/utility b/libstdc++-v3/include/tr1/utility
index e6e3bbd..cc2699d 100644
--- a/libstdc++-v3/include/tr1/utility
+++ b/libstdc++-v3/include/tr1/utility
@@ -31,6 +31,8 @@
#pragma GCC system_header
+#include <bits/requires_hosted.h> // TR1
+
#include <bits/c++config.h>
#include <bits/stl_relops.h>
#include <bits/stl_pair.h>
diff --git a/libstdc++-v3/include/tr1/wchar.h b/libstdc++-v3/include/tr1/wchar.h
index 503ca20..0812c07 100644
--- a/libstdc++-v3/include/tr1/wchar.h
+++ b/libstdc++-v3/include/tr1/wchar.h
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_WCHAR_H
#define _GLIBCXX_TR1_WCHAR_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cwchar>
#endif // _GLIBCXX_TR1_WCHAR_H
diff --git a/libstdc++-v3/include/tr1/wctype.h b/libstdc++-v3/include/tr1/wctype.h
index fa0e458..84fd7cc 100644
--- a/libstdc++-v3/include/tr1/wctype.h
+++ b/libstdc++-v3/include/tr1/wctype.h
@@ -29,6 +29,8 @@
#ifndef _GLIBCXX_TR1_WCTYPE_H
#define _GLIBCXX_TR1_WCTYPE_H 1
+#include <bits/requires_hosted.h> // TR1
+
#include <tr1/cwctype>
#endif // _GLIBCXX_TR1_WCTYPE_H
diff --git a/libstdc++-v3/testsuite/lib/prune.exp b/libstdc++-v3/testsuite/lib/prune.exp
index 70ff302..d457e97 100644
--- a/libstdc++-v3/testsuite/lib/prune.exp
+++ b/libstdc++-v3/testsuite/lib/prune.exp
@@ -33,6 +33,10 @@ proc libstdc++-dg-prune { system text } {
# send_user "Before:$text\n"
+ if { [string match "*This header is not available in freestanding mode.*" $text] } {
+ return "::unsupported::hosted C++ headers not supported"
+ }
+
# Ignore caret diagnostics. Unfortunately dejaGNU trims leading
# spaces, so one cannot rely on them being present.
regsub -all "(^|\n)\[^\n\]+\n *\\^\n" $text "\n" text