From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 9D6A2386F012 for ; Sat, 23 May 2020 08:43:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9D6A2386F012 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-21-eTTObRQhO7GY-QcENkIFJw-1; Sat, 23 May 2020 04:43:11 -0400 X-MC-Unique: eTTObRQhO7GY-QcENkIFJw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D28D8107ACCA; Sat, 23 May 2020 08:43:10 +0000 (UTC) Received: from localhost (unknown [10.33.36.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4682F5EE0C; Sat, 23 May 2020 08:43:09 +0000 (UTC) Date: Sat, 23 May 2020 09:43:09 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed 2/3] libstdc++: Remove incorrect static specifiers Message-ID: <20200523084309.GS2678@redhat.com> References: <20200523084043.GQ2678@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200523084043.GQ2678@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="9iyR+p8Z2cn535Lj" Content-Disposition: inline X-Spam-Status: No, score=-18.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 08:43:18 -0000 --9iyR+p8Z2cn535Lj Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline 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. Tested powerpc64le-linux, committed to master. --9iyR+p8Z2cn535Lj Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" 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 --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 --9iyR+p8Z2cn535Lj--