aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-04-03 13:59:14 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2025-04-04 10:29:57 +0100
commitaffdef57a45a443ead24f6afb7027a2683028031 (patch)
treedf959199535a9f9b51cee1c5f0e8da9508d8336e /libjava/classpath
parent4b884f3d6335539447d32c6462cc4ef52e30e273 (diff)
downloadgcc-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')
0 files changed, 0 insertions, 0 deletions