public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/giulianob/heads/autopar_rebase2)] libstdc++: Make COW string use allocator_traits for nested types
@ 2020-08-18 1:18 Giuliano Belinassi
0 siblings, 0 replies; only message in thread
From: Giuliano Belinassi @ 2020-08-18 1:18 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:505297f57e1919a2a328a136f20181cc5b81a807
commit 505297f57e1919a2a328a136f20181cc5b81a807
Author: Jonathan Wakely <jwakely@redhat.com>
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-18 1:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 1:18 [gcc(refs/users/giulianob/heads/autopar_rebase2)] libstdc++: Make COW string use allocator_traits for nested types Giuliano Belinassi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).