[gcc r17-2857] libstdc++: Implement LWG 4440 feature-test macros added to <iosfwd>
Patrick Palka via Gcc-cvs <[email protected]> Fri, 31 Jul 2026 18:13:56 +0000 (GMT)
| Newsgroups | gmane.comp.gcc.cvs |
|---|---|
| Message-ID | <20260731181356.C9A6A4BC7EF3__49510.3296519787$1785521649$gmane$org@sourceware.org> |
https://gcc.gnu.org/g:0cb732698c1cf5b5d7c4e2da64ad506e55fae551 commit r17-2857-g0cb732698c1cf5b5d7c4e2da64ad506e55fae551 Author: Patrick Palka <[email protected]> Date: Fri Jul 31 14:11:42 2026 -0400 libstdc++: Implement LWG 4440 feature-test macros added to <iosfwd> Note __cpp_lib_char8_t doesn't use the <bits/version.h> mechanism, it's defined in c++config and thus provided by all headers by default. libstdc++-v3/ChangeLog: * include/std/iosfwd: Provide feature-test macros __cpp_lib_spanstream and __cpp_lib_syncbuf. * testsuite/27_io/headers/iosfwd/synopsis.cc: Verify values of these FTMs. Reviewed-by: Tomasz KamiĆski <[email protected]> Reviewed-by: Jonathan Wakely <[email protected]> Diff: --- libstdc++-v3/include/std/iosfwd | 4 ++++ libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd index 1d5e684b53bb..511b2f3a23f1 100644 --- a/libstdc++-v3/include/std/iosfwd +++ b/libstdc++-v3/include/std/iosfwd @@ -39,6 +39,10 @@ #include <bits/requires_hosted.h> // iostreams +#define __glibcxx_want_spanstream +#define __glibcxx_want_syncbuf +#include <bits/version.h> + /** * @defgroup io I/O * diff --git a/libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc b/libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc index 8d9501f42ef4..81b158b81285 100644 --- a/libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc +++ b/libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc @@ -3,6 +3,18 @@ #include <iosfwd> +#if __cplusplus >= 202002L && __cpp_lib_char8_t != 201907L +# error "Feature-test macro __cpp_lib_char8_t has wrong value in <iosfwd>" +#endif + +#if __cplusplus >= 202202L && __cpp_lib_spanstream != 202106L +# error "Feature-test macro __cpp_lib_spanstrean has wrong value in <iosfwd>" +#endif + +#if __cplusplus >= 202002L && __cpp_lib_syncbuf != 201803L +# error "Feature-test macro __cpp_lib_syncbuf has wrong value in <iosfwd>" +#endif + namespace std { // [iosfwd.syn]