From: Jonathan Wakely Date: Fri, 1 Nov 2024 10:50:02 +0000 (+0000) Subject: libstdc++: Check feature test macro for associative container node extraction X-Git-Tag: basepoints/gcc-16~2603 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=408f5b847b5b4e552274dc7b02ccaf106395936d;p=thirdparty%2Fgcc.git libstdc++: Check feature test macro for associative container node extraction Replace some `__cplusplus > 201402L` preprocessor checks with more expressive checks for the appropriate feature test macro. libstdc++-v3/ChangeLog: * include/bits/stl_map.h: Check __glibcxx_node_extract instead of __cplusplus. * include/bits/stl_multimap.h: Likewise. * include/bits/stl_multiset.h: Likewise. * include/bits/stl_set.h: Likewise. * include/bits/stl_tree.h: Likewise. --- diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index c1c0f7577bb..d2d0b524cce 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -180,7 +180,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER typedef typename _Rep_type::reverse_iterator reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 using node_type = typename _Rep_type::node_type; using insert_return_type = typename _Rep_type::insert_return_type; #endif @@ -642,7 +642,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER } #endif -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 /// Extract a node. node_type extract(const_iterator __pos) diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index 426db214c04..661d870fd01 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -171,7 +171,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER typedef typename _Rep_type::reverse_iterator reverse_iterator; typedef typename _Rep_type::const_reverse_iterator const_reverse_iterator; -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 using node_type = typename _Rep_type::node_type; #endif @@ -632,7 +632,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { this->insert(__l.begin(), __l.end()); } #endif -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 /// Extract a node. node_type extract(const_iterator __pos) diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index 6c70e12884a..57caf6e8cc4 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -151,7 +151,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER typedef typename _Rep_type::size_type size_type; typedef typename _Rep_type::difference_type difference_type; -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 using node_type = typename _Rep_type::node_type; #endif @@ -566,7 +566,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { this->insert(__l.begin(), __l.end()); } #endif -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 /// Extract a node. node_type extract(const_iterator __pos) diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 975ac521d9a..f32323db368 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -154,7 +154,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER typedef typename _Rep_type::difference_type difference_type; ///@} -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 using node_type = typename _Rep_type::node_type; using insert_return_type = typename _Rep_type::insert_return_type; #endif @@ -581,7 +581,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER { this->insert(__l.begin(), __l.end()); } #endif -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 /// Extract a node. node_type extract(const_iterator __pos) diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h index ae9b4469d88..7285676f427 100644 --- a/libstdc++-v3/include/bits/stl_tree.h +++ b/libstdc++-v3/include/bits/stl_tree.h @@ -71,7 +71,7 @@ #if __cplusplus >= 201103L # include #endif -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 # include #endif @@ -1010,7 +1010,7 @@ namespace __rb_tree #endif } // namespace __rb_tree -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 template struct _Rb_tree_merge_helper { }; #endif @@ -1451,7 +1451,7 @@ namespace __rb_tree typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 using node_type = _Node_handle<_Key, _Val, _Node_allocator>; using insert_return_type = _Node_insert_return< __conditional_t, const_iterator, iterator>, @@ -3219,7 +3219,7 @@ namespace __rb_tree return true; } -#if __cplusplus > 201402L +#ifdef __glibcxx_node_extract // >= C++17 // Allow access to internals of compatible _Rb_tree specializations. template