]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove incorrect static specifiers
authorJonathan Wakely <jwakely@redhat.com>
Sat, 23 May 2020 17:40:53 +0000 (18:40 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 23 May 2020 17:40:53 +0000 (18:40 +0100)
These functions were originally static members of the path class, but
the 'static' specifiers were not removed when they were moved to
namespace scope. This causes ODR violations when the functions are
called from functions defined in the header. Change them to 'inline'
instead.

Backport from mainline
2020-05-23  Jonathan Wakely  <jwakely@redhat.com>

* include/bits/fs_path.h (__detail::_S_range_begin)
(__detail::_S_range_end): Remove unintentional static specifiers.
* include/experimental/bits/fs_path.h (__detail::_S_range_begin)
(__detail::_S_range_end): Likewise.

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fs_path.h
libstdc++-v3/include/experimental/bits/fs_path.h

index 323caae631c6cf92e9c53578a7c6a82111b82587..38f1e06255e7834aa4a0c30388ca9b8d221abeb4 100644 (file)
@@ -1,3 +1,13 @@
+2020-05-23  Jonathan Wakely  <jwakely@redhat.com>
+
+       Backport from mainline
+       2020-05-23  Jonathan Wakely  <jwakely@redhat.com>
+
+       * include/bits/fs_path.h (__detail::_S_range_begin)
+       (__detail::_S_range_end): Remove unintentional static specifiers.
+       * include/experimental/bits/fs_path.h (__detail::_S_range_begin)
+       (__detail::_S_range_end): Likewise.
+
 2020-05-23  Jonathan Wakely  <jwakely@redhat.com>
 
        Backport from mainline
index ee6ab15cc4c222b42be117d51a98eb3b41092548..fd80d8c642b0586eab9ac5baff8c0aea638c78e5 100644 (file)
@@ -127,32 +127,32 @@ namespace __detail
                     path>::type;
 
   template<typename _Source>
-    static _Source
+    _Source
     _S_range_begin(_Source __begin) { return __begin; }
 
   struct __null_terminated { };
 
   template<typename _Source>
-    static __null_terminated
+    __null_terminated
     _S_range_end(_Source) { return {}; }
 
   template<typename _CharT, typename _Traits, typename _Alloc>
-    static const _CharT*
+    inline const _CharT*
     _S_range_begin(const basic_string<_CharT, _Traits, _Alloc>& __str)
     { return __str.data(); }
 
   template<typename _CharT, typename _Traits, typename _Alloc>
-    static const _CharT*
+    inline const _CharT*
     _S_range_end(const basic_string<_CharT, _Traits, _Alloc>& __str)
     { return __str.data() + __str.size(); }
 
   template<typename _CharT, typename _Traits>
-    static const _CharT*
+    inline const _CharT*
     _S_range_begin(const basic_string_view<_CharT, _Traits>& __str)
     { return __str.data(); }
 
   template<typename _CharT, typename _Traits>
-    static const _CharT*
+    inline const _CharT*
     _S_range_end(const basic_string_view<_CharT, _Traits>& __str)
     { return __str.data() + __str.size(); }
 
index d7234c08a006a2e17a98de337303c519fc407813..69b823a34666dc9435abab36537775eb9715f5da 100644 (file)
@@ -137,33 +137,33 @@ namespace __detail
                     path>::type;
 
   template<typename _Source>
-    static _Source
+    inline _Source
     _S_range_begin(_Source __begin) { return __begin; }
 
   struct __null_terminated { };
 
   template<typename _Source>
-    static __null_terminated
+    inline __null_terminated
     _S_range_end(_Source) { return {}; }
 
   template<typename _CharT, typename _Traits, typename _Alloc>
-    static const _CharT*
+    inline const _CharT*
     _S_range_begin(const basic_string<_CharT, _Traits, _Alloc>& __str)
     { return __str.data(); }
 
   template<typename _CharT, typename _Traits, typename _Alloc>
-    static const _CharT*
+    inline const _CharT*
     _S_range_end(const basic_string<_CharT, _Traits, _Alloc>& __str)
     { return __str.data() + __str.size(); }
 
 #if __cplusplus >= 201402L
   template<typename _CharT, typename _Traits>
-    static const _CharT*
+    inline const _CharT*
     _S_range_begin(const basic_string_view<_CharT, _Traits>& __str)
     { return __str.data(); }
 
   template<typename _CharT, typename _Traits>
-    static const _CharT*
+    inline const _CharT*
     _S_range_end(const basic_string_view<_CharT, _Traits>& __str)
     { return __str.data() + __str.size(); }
 #endif