public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-10-branch)] libstdc++: Remove incorrect static specifiers
@ 2020-06-18 10:48 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2020-06-18 10:48 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:415d3cd72f6418d21bc4897676fc79368bfc8d36

commit 415d3cd72f6418d21bc4897676fc79368bfc8d36
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat May 23 18:40:53 2020 +0100

    libstdc++: Remove incorrect static specifiers
    
    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.

Diff:
---
 libstdc++-v3/ChangeLog                           | 10 ++++++++++
 libstdc++-v3/include/bits/fs_path.h              | 12 ++++++------
 libstdc++-v3/include/experimental/bits/fs_path.h | 12 ++++++------
 3 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 323caae631c..38f1e06255e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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
diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h
index ee6ab15cc4c..fd80d8c642b 100644
--- a/libstdc++-v3/include/bits/fs_path.h
+++ b/libstdc++-v3/include/bits/fs_path.h
@@ -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(); }
 
diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h
index d7234c08a00..69b823a3466 100644
--- a/libstdc++-v3/include/experimental/bits/fs_path.h
+++ b/libstdc++-v3/include/experimental/bits/fs_path.h
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-18 10:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18 10:48 [gcc(refs/vendors/redhat/heads/gcc-10-branch)] libstdc++: Remove incorrect static specifiers Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).