]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Avoid _GLIBCXX20_CONSTEXPR in C++ >= 20 code sections
authorFrançois Dumont <frs.dumont@gmail.com>
Wed, 1 Oct 2025 05:09:36 +0000 (07:09 +0200)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Wed, 1 Oct 2025 19:52:44 +0000 (21:52 +0200)
libstdc++-v3/ChangeLog:

* include/std/vector (std::erase_if, std::erase): Replace _GLIBCXX20_CONSTEXPR
with 'constexpr' and remove implied 'inline' keyword.
* include/std/string (std::erase_if, std::erase): Likewise.

libstdc++-v3/include/std/string
libstdc++-v3/include/std/vector

index 4b84aeaa857b90327263ee800ad8113bd379d988..97ded057a87b44553d91965cfc982571d9776a7c 100644 (file)
@@ -95,8 +95,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _CharT, typename _Traits, typename _Alloc,
           typename _Predicate>
-    _GLIBCXX20_CONSTEXPR
-    inline typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    constexpr typename basic_string<_CharT, _Traits, _Alloc>::size_type
     erase_if(basic_string<_CharT, _Traits, _Alloc>& __cont, _Predicate __pred)
     {
       using namespace __gnu_cxx;
@@ -110,8 +109,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _CharT, typename _Traits, typename _Alloc,
           typename _Up _GLIBCXX26_DEF_VAL_T(_CharT)>
-    _GLIBCXX20_CONSTEXPR
-    inline typename basic_string<_CharT, _Traits, _Alloc>::size_type
+    constexpr typename basic_string<_CharT, _Traits, _Alloc>::size_type
     erase(basic_string<_CharT, _Traits, _Alloc>& __cont, const _Up& __value)
     { return std::erase_if(__cont, __gnu_cxx::__ops::__equal_to(__value)); }
 
index cdc30cbff6deeba0daf7b2396a232c3f3e2ea3c5..3146f283944affb4d8601d9364d4c844ca3e37a6 100644 (file)
@@ -112,8 +112,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Tp, typename _Alloc, typename _Predicate>
-    _GLIBCXX20_CONSTEXPR
-    inline typename vector<_Tp, _Alloc>::size_type
+    constexpr typename vector<_Tp, _Alloc>::size_type
     erase_if(vector<_Tp, _Alloc>& __cont, _Predicate __pred)
     {
       using namespace __gnu_cxx;
@@ -134,8 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Tp, typename _Alloc,
           typename _Up _GLIBCXX26_DEF_VAL_T(_Tp)>
-    _GLIBCXX20_CONSTEXPR
-    inline typename vector<_Tp, _Alloc>::size_type
+    constexpr typename vector<_Tp, _Alloc>::size_type
     erase(vector<_Tp, _Alloc>& __cont, const _Up& __value)
     { return std::erase_if(__cont, __gnu_cxx::__ops::__equal_to(__value)); }