From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1725) id 5296D3842419; Tue, 18 Aug 2020 18:17:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5296D3842419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597774671; bh=hqTu7s1jjjbinN1cSWwFAubSxzCCwC71xgPVbR+daj4=; h=From:To:Subject:Date:From; b=nyWSZt8sLFXVgwpOJaceAq7rn/ZljgeE1/AziubCwPt69N/kE08yAiWlBry5BF7Ds GXuTpjYS0Th6ScusSTP5Tb3B6xTg2TpoB0k727/dizvIpbQpTWhowO8KCwG31HMZCL SAaq0bN85A2xTMnM8QSz0miDx0B1lcjLawXKL4Ss= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: William Schmidt To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/wschmidt/heads/builtins3)] libstdc++: Make COW string use allocator_traits for nested types X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/users/wschmidt/heads/builtins3 X-Git-Oldrev: e513e9aa53121e628e0403438a5bb3861a50c198 X-Git-Newrev: 684d6ee140af6585c18c8790f8f5bddfcc6bd153 Message-Id: <20200818181751.5296D3842419@sourceware.org> Date: Tue, 18 Aug 2020 18:17:51 +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, 18 Aug 2020 18:17:51 -0000 https://gcc.gnu.org/g:684d6ee140af6585c18c8790f8f5bddfcc6bd153 commit 684d6ee140af6585c18c8790f8f5bddfcc6bd153 Author: Jonathan Wakely Date: Thu Jul 30 20:58:09 2020 +0100 libstdc++: Make COW string use allocator_traits for nested types When compiled as C++20 the COW std::string fails due to assuming that the allocator always defines size_type and difference_type. That has been incorrect since C++11, but we got away with it for specializations using std::allocator until those members were removed in C++20. libstdc++-v3/ChangeLog: * include/bits/basic_string.h (size_type, difference_type): Use allocator_traits to obtain the allocator's size_type and difference_type. Diff: --- libstdc++-v3/include/bits/basic_string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index bc0c256b65e..52cecdd7ca1 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -3147,8 +3147,8 @@ _GLIBCXX_END_NAMESPACE_CXX11 typedef _Traits traits_type; typedef typename _Traits::char_type value_type; typedef _Alloc allocator_type; - typedef typename _CharT_alloc_type::size_type size_type; - typedef typename _CharT_alloc_type::difference_type difference_type; + typedef typename _CharT_alloc_traits::size_type size_type; + typedef typename _CharT_alloc_traits::difference_type difference_type; #if __cplusplus < 201103L typedef typename _CharT_alloc_type::reference reference; typedef typename _CharT_alloc_type::const_reference const_reference;