From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id DF797389616D; Tue, 26 May 2020 04:41:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF797389616D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590468066; bh=Vlwv6fYeZ3fhjd4Iv1sj86tO8Y/qPdQfsUrATtCkY6E=; h=From:To:Subject:Date:From; b=vpk/E7HKcbMkoMtrsBBBs4vUQ5SuCYGHjTXxm579OrvJTNHU59lYdXkidDUKJtqMO QEQJqi89jPo9ba8b7bDYbrc1GQhX9oVb6VctezgnOHh3/NxZmDDo0HTjQ0Nh5cU4Pl PSuhi/A578DGEiPb/gF/GopRJsATYcjNui9eHwbU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] libstdc++: Remove incorrect static specifiers X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 988b853f9c829742907ae22ac66de56facfc7bc5 X-Git-Newrev: 00c8f2a5e3a21d93a03182cacbae4badc02a37f1 Message-Id: <20200526044106.DF797389616D@sourceware.org> Date: Tue, 26 May 2020 04:41:06 +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: Tue, 26 May 2020 04:41:07 -0000 https://gcc.gnu.org/g:00c8f2a5e3a21d93a03182cacbae4badc02a37f1 commit 00c8f2a5e3a21d93a03182cacbae4badc02a37f1 Author: Jonathan Wakely Date: Sat May 23 09:00:16 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, which is incompatible with Nathan's modules branch. Change them to 'inline' instead. * 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 | 5 +++++ libstdc++-v3/include/bits/fs_path.h | 12 ++++++------ libstdc++-v3/include/experimental/bits/fs_path.h | 12 ++++++------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b82479f0ed6..af52f143be8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 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. + * include/bits/fs_path.h (filesystem::__detail::__is_encoded_char): Replace alias template with variable template. Don't remove const. (filesystem::__detail::__is_path_src): Replace overloaded function diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h index 5a998284a99..818b5918927 100644 --- a/libstdc++-v3/include/bits/fs_path.h +++ b/libstdc++-v3/include/bits/fs_path.h @@ -156,32 +156,32 @@ namespace __detail using _Path2 = enable_if_t<__is_path_iter_src<_Tr>::value, path>; 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