From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1534) id 401C53939C08; Wed, 10 Jun 2020 10:32:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 401C53939C08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591785150; bh=jTi/lHBqHqhVVht7k74GLexGskvVE1KmnYdNJ1KG1nU=; h=From:To:Subject:Date:From; b=lPZcHvR9Q2o6hM1EXfijf5wxfTE6aVritsfYSCQdlpsyxF2pN6PeRM8G6sYgRVnuv za3h94Xd6YAn53SEipAgpbNEnzwmoda7nXCEt/tDZI/J8cw5Z5fqu1UjnVj5NyYzSO SSlIgJzNPBXseNSm9+t8mdpK2nDTAqW7ksTqvQk0= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tobias Burnus To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-10] libstdc++: Remove incorrect static specifiers X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/devel/omp/gcc-10 X-Git-Oldrev: 3ba391077d41324f6c0585f0ec76be0f44dd5b43 X-Git-Newrev: 415d3cd72f6418d21bc4897676fc79368bfc8d36 Message-Id: <20200610103230.401C53939C08@sourceware.org> Date: Wed, 10 Jun 2020 10:32:30 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 10:32:30 -0000 https://gcc.gnu.org/g:415d3cd72f6418d21bc4897676fc79368bfc8d36 commit 415d3cd72f6418d21bc4897676fc79368bfc8d36 Author: Jonathan Wakely 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 * 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 + + Backport from mainline + 2020-05-23 Jonathan Wakely + + * 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 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 - static _Source + _Source _S_range_begin(_Source __begin) { return __begin; } struct __null_terminated { }; template - static __null_terminated + __null_terminated _S_range_end(_Source) { return {}; } template - static const _CharT* + inline const _CharT* _S_range_begin(const basic_string<_CharT, _Traits, _Alloc>& __str) { return __str.data(); } template - static const _CharT* + inline const _CharT* _S_range_end(const basic_string<_CharT, _Traits, _Alloc>& __str) { return __str.data() + __str.size(); } template - static const _CharT* + inline const _CharT* _S_range_begin(const basic_string_view<_CharT, _Traits>& __str) { return __str.data(); } template - 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 - static _Source + inline _Source _S_range_begin(_Source __begin) { return __begin; } struct __null_terminated { }; template - static __null_terminated + inline __null_terminated _S_range_end(_Source) { return {}; } template - static const _CharT* + inline const _CharT* _S_range_begin(const basic_string<_CharT, _Traits, _Alloc>& __str) { return __str.data(); } template - 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 - static const _CharT* + inline const _CharT* _S_range_begin(const basic_string_view<_CharT, _Traits>& __str) { return __str.data(); } template - static const _CharT* + inline const _CharT* _S_range_end(const basic_string_view<_CharT, _Traits>& __str) { return __str.data() + __str.size(); } #endif