From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 73C25388A423; Fri, 20 Nov 2020 13:49:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 73C25388A423 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r10-9057] libstdc++: Remove dependency from [PR 92546] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-10 X-Git-Oldrev: a186d72afd6cfb13efd4a0ec82049d79892334fd X-Git-Newrev: cbbc28706164873d0323d1a6c7988be3f4d971c9 Message-Id: <20201120134916.73C25388A423@sourceware.org> Date: Fri, 20 Nov 2020 13:49:16 +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: Fri, 20 Nov 2020 13:49:16 -0000 https://gcc.gnu.org/g:cbbc28706164873d0323d1a6c7988be3f4d971c9 commit r10-9057-gcbbc28706164873d0323d1a6c7988be3f4d971c9 Author: Jonathan Wakely Date: Fri Nov 20 11:30:33 2020 +0000 libstdc++: Remove dependency from [PR 92546] Unlike the other headers that declare alias templates in namespace pmr, includes . That was done because the pmr::string::const_iterator typedef requires pmr::string to be complete, which requires pmr::polymorphic_allocator to be complete. By using __normal_iterator instead of the const_iterator typedef we can avoid the completeness requirement. This makes smaller, by not requiring and its dependency, which depends on . Backporting this will also help with PR 97876, where ends up being needed by via . libstdc++-v3/ChangeLog: PR libstdc++/92546 * include/std/regex (pmr::smatch, pmr::wsmatch): Declare using underlying __normal_iterator type, not nested typedef basic_string::const_iterator. (cherry picked from commit 640ebeb336050887cb57417b7568279c588088f0) Diff: --- libstdc++-v3/include/std/regex | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/include/std/regex b/libstdc++-v3/include/std/regex index b4b8ea7daca..a64318a2a94 100644 --- a/libstdc++-v3/include/std/regex +++ b/libstdc++-v3/include/std/regex @@ -63,21 +63,25 @@ #include #if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI -#include namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION - namespace pmr { + namespace pmr + { template class polymorphic_allocator; template using match_results = std::match_results<_BidirectionalIterator, polymorphic_allocator< sub_match<_BidirectionalIterator>>>; - using cmatch = match_results; - using smatch = match_results; + using cmatch = match_results; + // Use __normal_iterator directly, because pmr::string::const_iterator + // would require pmr::polymorphic_allocator to be complete. + using smatch + = match_results<__gnu_cxx::__normal_iterator>; #ifdef _GLIBCXX_USE_WCHAR_T using wcmatch = match_results; - using wsmatch = match_results; + using wsmatch + = match_results<__gnu_cxx::__normal_iterator>; #endif } // namespace pmr _GLIBCXX_END_NAMESPACE_VERSION