diff options
author | Arsen Arsenović <arsen@aarsen.me> | 2022-09-19 21:54:49 +0200 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-10-03 15:43:48 +0100 |
commit | 18f176d0b25591e2880bc5ef453ce0834f9e0e2a (patch) | |
tree | 922b20453d486749393bf9161b96f40125caaf33 /libstdc++-v3/include/std | |
parent | 06b3c0fad1b5fe7b72e666c336595c6324933960 (diff) | |
download | gcc-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/include/std')
48 files changed, 145 insertions, 56 deletions
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 |