libstdc++: Mark headers that must be hosted as such [PR103626]
authorArsen Arsenović <arsen@aarsen.me>
Mon, 19 Sep 2022 19:54:49 +0000 (21:54 +0200)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 3 Oct 2022 14:43:48 +0000 (15:43 +0100)
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.

170 files changed:
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/bits/algorithmfwd.h
libstdc++-v3/include/bits/concept_check.h
libstdc++-v3/include/bits/ranges_algo.h
libstdc++-v3/include/bits/requires_hosted.h [new file with mode: 0644]
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/include/c_global/cmath
libstdc++-v3/include/experimental/algorithm
libstdc++-v3/include/experimental/any
libstdc++-v3/include/experimental/array
libstdc++-v3/include/experimental/buffer
libstdc++-v3/include/experimental/chrono
libstdc++-v3/include/experimental/deque
libstdc++-v3/include/experimental/executor
libstdc++-v3/include/experimental/filesystem
libstdc++-v3/include/experimental/forward_list
libstdc++-v3/include/experimental/functional
libstdc++-v3/include/experimental/internet
libstdc++-v3/include/experimental/io_context
libstdc++-v3/include/experimental/iterator
libstdc++-v3/include/experimental/list
libstdc++-v3/include/experimental/map
libstdc++-v3/include/experimental/memory
libstdc++-v3/include/experimental/memory_resource
libstdc++-v3/include/experimental/net
libstdc++-v3/include/experimental/netfwd
libstdc++-v3/include/experimental/numeric
libstdc++-v3/include/experimental/optional
libstdc++-v3/include/experimental/propagate_const
libstdc++-v3/include/experimental/random
libstdc++-v3/include/experimental/ratio
libstdc++-v3/include/experimental/regex
libstdc++-v3/include/experimental/scope
libstdc++-v3/include/experimental/set
libstdc++-v3/include/experimental/simd
libstdc++-v3/include/experimental/socket
libstdc++-v3/include/experimental/source_location
libstdc++-v3/include/experimental/string
libstdc++-v3/include/experimental/string_view
libstdc++-v3/include/experimental/system_error
libstdc++-v3/include/experimental/timer
libstdc++-v3/include/experimental/tuple
libstdc++-v3/include/experimental/unordered_map
libstdc++-v3/include/experimental/unordered_set
libstdc++-v3/include/experimental/utility
libstdc++-v3/include/experimental/vector
libstdc++-v3/include/ext/algorithm
libstdc++-v3/include/ext/bitmap_allocator.h
libstdc++-v3/include/ext/cmath
libstdc++-v3/include/ext/codecvt_specializations.h
libstdc++-v3/include/ext/debug_allocator.h
libstdc++-v3/include/ext/enc_filebuf.h
libstdc++-v3/include/ext/extptr_allocator.h
libstdc++-v3/include/ext/functional
libstdc++-v3/include/ext/malloc_allocator.h
libstdc++-v3/include/ext/memory
libstdc++-v3/include/ext/mt_allocator.h
libstdc++-v3/include/ext/new_allocator.h
libstdc++-v3/include/ext/numeric
libstdc++-v3/include/ext/pod_char_traits.h
libstdc++-v3/include/ext/pointer.h
libstdc++-v3/include/ext/pool_allocator.h
libstdc++-v3/include/ext/random
libstdc++-v3/include/ext/random.tcc
libstdc++-v3/include/ext/rb_tree
libstdc++-v3/include/ext/rc_string_base.h
libstdc++-v3/include/ext/rope
libstdc++-v3/include/ext/ropeimpl.h
libstdc++-v3/include/ext/slist
libstdc++-v3/include/ext/sso_string_base.h
libstdc++-v3/include/ext/stdio_filebuf.h
libstdc++-v3/include/ext/stdio_sync_filebuf.h
libstdc++-v3/include/ext/string_conversions.h
libstdc++-v3/include/ext/throw_allocator.h
libstdc++-v3/include/ext/vstring.h
libstdc++-v3/include/ext/vstring.tcc
libstdc++-v3/include/ext/vstring_fwd.h
libstdc++-v3/include/ext/vstring_util.h
libstdc++-v3/include/std/algorithm
libstdc++-v3/include/std/barrier
libstdc++-v3/include/std/charconv
libstdc++-v3/include/std/chrono
libstdc++-v3/include/std/condition_variable
libstdc++-v3/include/std/deque
libstdc++-v3/include/std/execution
libstdc++-v3/include/std/filesystem
libstdc++-v3/include/std/forward_list
libstdc++-v3/include/std/fstream
libstdc++-v3/include/std/functional
libstdc++-v3/include/std/future
libstdc++-v3/include/std/iomanip
libstdc++-v3/include/std/ios
libstdc++-v3/include/std/iosfwd
libstdc++-v3/include/std/iostream
libstdc++-v3/include/std/istream
libstdc++-v3/include/std/iterator
libstdc++-v3/include/std/latch
libstdc++-v3/include/std/list
libstdc++-v3/include/std/locale
libstdc++-v3/include/std/map
libstdc++-v3/include/std/memory
libstdc++-v3/include/std/memory_resource
libstdc++-v3/include/std/mutex
libstdc++-v3/include/std/numeric
libstdc++-v3/include/std/ostream
libstdc++-v3/include/std/queue
libstdc++-v3/include/std/random
libstdc++-v3/include/std/regex
libstdc++-v3/include/std/semaphore
libstdc++-v3/include/std/set
libstdc++-v3/include/std/shared_mutex
libstdc++-v3/include/std/spanstream
libstdc++-v3/include/std/sstream
libstdc++-v3/include/std/stack
libstdc++-v3/include/std/stacktrace
libstdc++-v3/include/std/stop_token
libstdc++-v3/include/std/streambuf
libstdc++-v3/include/std/string
libstdc++-v3/include/std/syncstream
libstdc++-v3/include/std/system_error
libstdc++-v3/include/std/thread
libstdc++-v3/include/std/unordered_map
libstdc++-v3/include/std/unordered_set
libstdc++-v3/include/std/valarray
libstdc++-v3/include/std/vector
libstdc++-v3/include/std/version
libstdc++-v3/include/tr1/array
libstdc++-v3/include/tr1/ccomplex
libstdc++-v3/include/tr1/cctype
libstdc++-v3/include/tr1/cfenv
libstdc++-v3/include/tr1/cfloat
libstdc++-v3/include/tr1/cinttypes
libstdc++-v3/include/tr1/climits
libstdc++-v3/include/tr1/cmath
libstdc++-v3/include/tr1/complex
libstdc++-v3/include/tr1/complex.h
libstdc++-v3/include/tr1/cstdarg
libstdc++-v3/include/tr1/cstdbool
libstdc++-v3/include/tr1/cstdint
libstdc++-v3/include/tr1/cstdio
libstdc++-v3/include/tr1/cstdlib
libstdc++-v3/include/tr1/ctgmath
libstdc++-v3/include/tr1/ctime
libstdc++-v3/include/tr1/ctype.h
libstdc++-v3/include/tr1/cwchar
libstdc++-v3/include/tr1/cwctype
libstdc++-v3/include/tr1/fenv.h
libstdc++-v3/include/tr1/float.h
libstdc++-v3/include/tr1/functional
libstdc++-v3/include/tr1/inttypes.h
libstdc++-v3/include/tr1/limits.h
libstdc++-v3/include/tr1/math.h
libstdc++-v3/include/tr1/memory
libstdc++-v3/include/tr1/random
libstdc++-v3/include/tr1/regex
libstdc++-v3/include/tr1/stdarg.h
libstdc++-v3/include/tr1/stdbool.h
libstdc++-v3/include/tr1/stdint.h
libstdc++-v3/include/tr1/stdio.h
libstdc++-v3/include/tr1/stdlib.h
libstdc++-v3/include/tr1/tgmath.h
libstdc++-v3/include/tr1/tuple
libstdc++-v3/include/tr1/type_traits
libstdc++-v3/include/tr1/unordered_map
libstdc++-v3/include/tr1/unordered_set
libstdc++-v3/include/tr1/utility
libstdc++-v3/include/tr1/wchar.h
libstdc++-v3/include/tr1/wctype.h
libstdc++-v3/testsuite/lib/prune.exp

index 3472e84..5622742 100644 (file)
@@ -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 \
index 39ef34f..f6ed98f 100644 (file)
@@ -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 \
index aacc34e..0833052 100644 (file)
@@ -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
index 35969d2..32b794d 100644 (file)
@@ -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)
index 228e10b..de71bd0 100644 (file)
@@ -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 (file)
index 0000000..86916e2
--- /dev/null
@@ -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
index e63fe66..6386918 100644 (file)
@@ -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
 
   /**
index 1b993f3..cc14982 100644 (file)
@@ -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>
index 5a4a022..99348cb 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <algorithm>
index b8ff90a..b8ab5a8 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <typeinfo>
index 3a064d2..f2bdd65 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <array>
index 0c103e1..bc34618 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <array>
index 8ec3191..417f8be 100644 (file)
@@ -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>
index b64deee..4f3d12d 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <deque>
index bfcf217..9d0cd6e 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <algorithm>
index 85872e6..7c47e6b 100644 (file)
@@ -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>
index fedf2ba..679b43d 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <forward_list>
index 1a47b52..a0e73fa 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <functional>
index 4be4bfb..6e3c355 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <experimental/netfwd>
index 8d4fc25..cea2a86 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <atomic>
index e68d09c..35ac5a6 100644 (file)
@@ -36,6 +36,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <iterator>
index 7e4ef18..7d49eef 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <list>
index 4936a66..525252b 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <map>
index 6cf11b4..fabeb58 100644 (file)
@@ -36,6 +36,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <memory>
index d70a932..aa86c04 100644 (file)
@@ -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
index 9d1d5c7..1268528 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <experimental/executor>
index 2fd6ff9..e1e0533 100644 (file)
@@ -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
index 426d943..26be27a 100644 (file)
@@ -36,6 +36,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <numeric>
index 0d3a894..c5da58a 100644 (file)
@@ -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>
index 80fcb2c..258ef6f 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <type_traits>
index adef31f..8728aa3 100644 (file)
@@ -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>
index 59ce85e..5d873f2 100644 (file)
@@ -36,6 +36,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <ratio>
index 9d063c6..5efb886 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <regex>
index 208fadc..5dbeac1 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 202002L
 
 #include <concepts>
index aa43a2b..b42a3cd 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <set>
index f526c70..4bd4648 100644 (file)
@@ -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
index 868927a..65fe2b7 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <experimental/netfwd>
index afd3401..acd41c0 100644 (file)
@@ -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>
 
index 01bd84b..f326b85 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <string>
index ff04bb1..f5b4cf1 100644 (file)
@@ -36,6 +36,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <string>
index 9023d44..f41cddd 100644 (file)
@@ -36,6 +36,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <system_error>
index 745f3a4..02498b0 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <bits/chrono.h>
index 338f2f5..906bd7b 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <tuple>
index 1a41687..ce56c2a 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <unordered_map>
index 583c437..c707587 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <unordered_set>
index 6156731..cc335e0 100644 (file)
@@ -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>
index 2b611fc..4e8c846 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // experimental is currently omitted
+
 #if __cplusplus >= 201402L
 
 #include <vector>
index f5eced6..65122da 100644 (file)
@@ -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)
index 033f132..80b8fa7 100644 (file)
@@ -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.
index 2291969..2ebad8b 100644 (file)
@@ -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
index 51b638d..7f733e6 100644 (file)
@@ -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>
index 3490dca..06c15fb 100644 (file)
@@ -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>
index 12869a8..fc3d9a8 100644 (file)
@@ -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>
index 20f746e..ad538c7 100644 (file)
@@ -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>
index 19cd8d5..9cf864d 100644 (file)
@@ -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)
index 82b3f0a..6323ed9 100644 (file)
@@ -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>
index 105952a..9e0082b 100644 (file)
@@ -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>
 
index 393d6eb..49743e4 100644 (file)
@@ -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>
index 96e6523..db8895f 100644 (file)
@@ -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)
index 0b2c4ee..1d9f4f4 100644 (file)
@@ -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>
 
index fa0f5b6..95d90f3 100644 (file)
@@ -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)
index 04804f0..48b7684 100644 (file)
 
 #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
index 8d0f089..f04a88c 100644 (file)
@@ -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>
index 50505b8..4cc0e25 100644 (file)
@@ -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
index 71ceea8..7274e0d 100644 (file)
@@ -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
index b61c45b..dd685fb 100644 (file)
@@ -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)
index f196d88..21ccfc2 100644 (file)
@@ -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>
index f8af374..a5a821e 100644 (file)
@@ -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>
index 27cb738..fe35d91 100644 (file)
@@ -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
              }
index 7b6f882..f2b5109 100644 (file)
@@ -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>
index f2209e7..db5dc43 100644 (file)
@@ -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
index 878839b..0e83e35 100644 (file)
@@ -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)
index 49437c9..8f51ae2 100644 (file)
@@ -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
index fc03974..a4648a9 100644 (file)
@@ -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
index 220f5f5..a1b57e7 100644 (file)
@@ -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>
index 47cbabf..f0a12d6 100644 (file)
@@ -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
index 0776fdc..18e4bbb 100644 (file)
@@ -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)
index c787e95..121492b 100644 (file)
@@ -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>
index 713c697..4e58a71 100644 (file)
@@ -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
index e2cfd7c..4b39bfc 100644 (file)
@@ -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>
index 997e0a8..ab6dd8b 100644 (file)
@@ -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
index 533320e..64d0584 100644 (file)
@@ -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
 
index 3732a40..c0c3a67 100644 (file)
@@ -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
index 06c4ff9..b885e1b 100644 (file)
@@ -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
index abdc2e0..0b692f1 100644 (file)
@@ -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>
index e933a1a..17f62a2 100644 (file)
@@ -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>
index dd112a2..36d71dd 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h>
+
 #if __cplusplus >= 201703L
 
 /**
index fe99e5e..5d8052c 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // containers
+
 #if __cplusplus < 201103L
 # include <bits/c++0x_warning.h>
 #else
index e62a1ad..c434664 100644 (file)
@@ -35,6 +35,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // iostreams
+
 #include <istream>
 #include <ostream>
 #include <bits/codecvt.h>
index 5235ef2..adf9cb1 100644 (file)
@@ -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
     {
index cf08c15..8c968fe 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // concurrency
+
 #if __cplusplus < 201103L
 # include <bits/c++0x_warning.h>
 #else
index 5371681..f73519d 100644 (file)
@@ -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>
index 50a66cd..c759986 100644 (file)
@@ -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
index ddf0c95..7f156f8 100644 (file)
@@ -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>
index d705913..685d29a 100644 (file)
@@ -35,6 +35,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // iostreams
+
 #include <bits/c++config.h>
 #include <ostream>
 #include <istream>
index 416ef55..58716ce 100644 (file)
@@ -35,6 +35,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // iostreams
+
 #include <ios>
 #include <ostream>
 
index fb2a47c..8ee8327 100644 (file)
@@ -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 */
index 7ae9022..0442f09 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // concurrency
+
 #if __cplusplus > 201703L
 
 #include <bits/atomic_base.h>
index 9151e98..ec174ed 100644 (file)
@@ -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>
index ae83586..abfed05 100644 (file)
@@ -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>
index ce07f29..c973a8e 100644 (file)
@@ -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>
index 3eff121..4336724 100644 (file)
 #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
index 19c9225..323956e 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // polymorphic allocation
+
 #if __cplusplus >= 201703L
 
 #include <bits/memory_resource.h>
index b9590bb..b310c15 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // concurrency
+
 #if __cplusplus < 201103L
 # include <bits/c++0x_warning.h>
 #else
index 60a99d1..0f1f26c 100644 (file)
@@ -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
index 291ea40..674decf 100644 (file)
@@ -35,6 +35,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // iostreams
+
 #include <ios>
 #include <bits/ostream_insert.h>
 
index db81ef1..7c4952f 100644 (file)
@@ -57,6 +57,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // containers
+
 #include <deque>
 #include <vector>
 #include <bits/stl_heap.h>
index 89a2f16..66757f7 100644 (file)
@@ -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
index 491bced..aa50c7e 100644 (file)
@@ -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
index 8a31c6d..72d68dd 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // concurrency
+
 #if __cplusplus > 201703L
 #include <bits/semaphore_base.h>
 
index 551c777..4cbcba1 100644 (file)
@@ -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>
index 817a958..cf74b32 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // concurrency
+
 #if __cplusplus >= 201402L
 
 #include <bits/chrono.h>
index 5855b28..6abf013 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // iostreams
+
 #if __cplusplus > 202002L
 #include <span>
 #include <streambuf>
index bc7d636..7305bdb 100644 (file)
@@ -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
index fc14e2e..98d2123 100644 (file)
@@ -57,6 +57,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // containers
+
 #include <deque>
 #include <bits/stl_stack.h>
 
index 39472d7..e7cbbee 100644 (file)
@@ -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
index 07d4fda..f196834 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _GLIBCXX_STOP_TOKEN
 #define _GLIBCXX_STOP_TOKEN
 
+#include <bits/requires_hosted.h> // concurrency
+
 #if __cplusplus > 201703L
 
 #include <atomic>
index 888611d..d8893df 100644 (file)
@@ -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>
index 62ecdb3..41e6e2c 100644 (file)
@@ -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>
index 7a4f731..838cec5 100644 (file)
@@ -38,6 +38,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // iostreams
+
 #include <sstream>
 
 #include <bits/alloc_traits.h>
index e12bb2f..6dad75d 100644 (file)
@@ -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
index 82f191a..a314b9e 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // concurrency
+
 #if __cplusplus < 201103L
 # include <bits/c++0x_warning.h>
 #else
index b50ec2a..323edcd 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // container
+
 #if __cplusplus < 201103L
 # include <bits/c++0x_warning.h>
 #else
index edaa517..998417f 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // containers
+
 #if __cplusplus < 201103L
 # include <bits/c++0x_warning.h>
 #else
index 87fec2b..90bbed7 100644 (file)
@@ -33,6 +33,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // <cmath> dependant
+
 #include <bits/c++config.h>
 #include <cmath>
 #include <algorithm>
index d7f69fd..75377d5 100644 (file)
@@ -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>
index 3fd5182..397a4aa 100644 (file)
 
 #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
 #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
 #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
 # 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
 #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
 #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
 # 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
 #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
  && __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
 #  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
 # 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
 #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
 # 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
 #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
index 2aac0ed..f03ad81 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <bits/stl_algobase.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
index 8f9546e..1b632be 100644 (file)
@@ -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
index 43520c7..2c4a15b 100644 (file)
@@ -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>
 
index 202fe27..37e06c6 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <bits/c++config.h>
 
 #if _GLIBCXX_HAVE_FENV_H
index 2456513..76bfcfb 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _GLIBCXX_TR1_CFLOAT
 #define _GLIBCXX_TR1_CFLOAT 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <cfloat>
 
 #ifndef DECIMAL_DIG
index a04cf24..24b4648 100644 (file)
@@ -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)
index 95e3bc3..0d702dc 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _GLIBCXX_TR1_CLIMITS
 #define _GLIBCXX_TR1_CLIMITS 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <climits>
 
 #ifndef LLONG_MIN
index f3a53f3..384f116 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <cmath>
 
 #ifdef _GLIBCXX_USE_C99_MATH_TR1
index abb5e13..fa88cd5 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <complex>
 
 namespace std _GLIBCXX_VISIBILITY(default)
index f282478..c5fb4c1 100644 (file)
@@ -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
index f28ff2a..f046e81 100644 (file)
@@ -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
index 77c0315..20afb63 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <bits/c++config.h>
 
 #if _GLIBCXX_HAVE_STDBOOL_H
index 0d13b30..9e3e45c 100644 (file)
@@ -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)
index 4692d21..dcbff6a 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <cstdio>
 
 #if _GLIBCXX_USE_C99_STDIO
index de952bb..5569b0d 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <cstdlib>
 
 #if _GLIBCXX_HOSTED
index 64ef405..15ada9c 100644 (file)
@@ -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
index 8b9b869..99b529a 100644 (file)
@@ -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
index 91177ff..014fc2b 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _TR1_CTYPE_H
 #define _TR1_CTYPE_H 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <tr1/cctype>
 
 #endif
index 23219bc..1140eda 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <cwchar>
 
 #ifdef _GLIBCXX_USE_WCHAR_T
index 1a71dd0..ddb25af 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <cwctype>
 
 #ifdef _GLIBCXX_USE_WCHAR_T
index 091b0b8..2547f00 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _TR1_FENV_H
 #define _TR1_FENV_H 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <tr1/cfenv>
 
 #endif
index 2367078..1dd3ef1 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _TR1_FLOAT_H
 #define _TR1_FLOAT_H 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <tr1/cfloat>
 
 #endif
index 83d22be..ae219ab 100644 (file)
@@ -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>
index 22a7514..eb5ddbe 100644 (file)
@@ -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
index b54f9d2..73baf85 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _TR1_LIMITS_H
 #define _TR1_LIMITS_H 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <tr1/climits>
 
 #endif
index 423b5ea..99c8f45 100644 (file)
@@ -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
index b50a558..759000b 100644 (file)
@@ -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
index cb57540..f9fbd4d 100644 (file)
@@ -32,6 +32,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <cmath>
 #include <cstdio>
 #include <cstdlib>
index 10db372..bcdea9d 100644 (file)
@@ -33,6 +33,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <algorithm>
 #include <bitset>
 #include <iterator>
index 446dda1..4622f33 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _TR1_STDARG_H
 #define _TR1_STDARG_H 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <tr1/cstdarg>
 
 #endif
index 76d0b72..368e891 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _TR1_STDBOOL_H
 #define _TR1_STDBOOL_H 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <tr1/cstdbool>
 
 #endif
index 59c1d95..b19361b 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _TR1_STDINT_H
 #define _TR1_STDINT_H 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <tr1/cstdint>
 
 #endif
index f7cc5c7..3ef65f9 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef _TR1_STDIO_H
 #define _TR1_STDIO_H 1
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <tr1/cstdio>
 
 #endif
index 0e9c605..0963136 100644 (file)
@@ -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
index 3871c3c..a3505c9 100644 (file)
@@ -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
index 94b1c0d..a24da25 100644 (file)
@@ -34,6 +34,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <utility>
 
 namespace std _GLIBCXX_VISIBILITY(default)
index 2ee3b06..305a0d0 100644 (file)
@@ -31,6 +31,8 @@
 
 #pragma GCC system_header
 
+#include <bits/requires_hosted.h> // TR1
+
 #include <bits/c++config.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
index edec4e2..24d3892 100644 (file)
@@ -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>
index fa11b16..59f0ab9 100644 (file)
@@ -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>
index e6e3bbd..cc2699d 100644 (file)
@@ -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>
index 503ca20..0812c07 100644 (file)
@@ -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
index fa0e458..84fd7cc 100644 (file)
@@ -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
index 70ff302..d457e97 100644 (file)
@@ -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