diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2025-04-03 13:59:14 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-04-04 10:29:57 +0100 |
commit | affdef57a45a443ead24f6afb7027a2683028031 (patch) | |
tree | df959199535a9f9b51cee1c5f0e8da9508d8336e /libjava/classpath/lib | |
parent | 4b884f3d6335539447d32c6462cc4ef52e30e273 (diff) | |
download | gcc-affdef57a45a443ead24f6afb7027a2683028031.zip gcc-affdef57a45a443ead24f6afb7027a2683028031.tar.gz gcc-affdef57a45a443ead24f6afb7027a2683028031.tar.bz2 |
libstdc++: Check feature test macro for std::string_view in <string>
We can use the __glibcxx_string_view macro to guard the uses of
std::string_view in <string>, instead of just checking the value of
__cplusplus. It makes no practical difference because
__glibcxx_string_view is defined for C++17 and up, but it makes it clear
to readers that the lines guarded by that macro are features that depend
on string_view.
We could be more precise and check __glibcxx_string_view >= 201606L
which is the value for the P0254R2 paper that integrated
std::string_view with std::string, but I think just checking for the
macro being defined is clear enough.
We can also check __glibcxx_variant for the _Never_valueless_alt partial
specialization.
libstdc++-v3/ChangeLog:
* include/bits/basic_string.h: Check __glibcxx_string_view and
__glibcxx_variant instead of __cplusplus >= 2017L.
* include/bits/cow_string.h: Likewise.
Reviewed-by: Tomasz KamiĆski <tkaminsk@redhat.com>
Diffstat (limited to 'libjava/classpath/lib')
0 files changed, 0 insertions, 0 deletions