This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] libstdc++/55409 C++11 allocator support for std::list


On 17/06/15 21:36 +0100, Jonathan Wakely wrote:
I didn't get time to finish this for 5.1, but this adds missing C++11
allocator support to std::list.

François pointed out that this change means we can update
__gnu_debug::list to derive from an allocator-aware _Safe_sequence.

We can do the same for __cxx11::basic_string by evaluating
bool(_GLIBCXX_USE_CXX11_ABI).

Tested powerpc64-linux, committed to trunk.
commit e5fb5e8dc5d1b1ffeaa48cd1d05f76ee93bc377d
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jun 18 10:02:15 2015 +0100

    	* include/debug/list (__gnu_debug::list): Use allocator-aware
    	_Safe_container base.
    	* include/debug/string (__gnu_debug::basic_string): Use
    	allocator-aware _Safe_container base for cxx11 ABI.

diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
index 1562946..12ac53c 100644
--- a/libstdc++-v3/include/debug/list
+++ b/libstdc++-v3/include/debug/list
@@ -43,12 +43,12 @@ namespace __debug
     class list
     : public __gnu_debug::_Safe_container<
 	list<_Tp, _Allocator>, _Allocator,
-	__gnu_debug::_Safe_node_sequence, false>,
+	__gnu_debug::_Safe_node_sequence>,
       public _GLIBCXX_STD_C::list<_Tp, _Allocator>
     {
-      typedef _GLIBCXX_STD_C::list<_Tp, _Allocator>			_Base;
+      typedef _GLIBCXX_STD_C::list<_Tp, _Allocator>		_Base;
       typedef __gnu_debug::_Safe_container<
-	list, _Allocator, __gnu_debug::_Safe_node_sequence, false>	_Safe;
+	list, _Allocator, __gnu_debug::_Safe_node_sequence>	_Safe;
 
       typedef typename _Base::iterator		_Base_iterator;
       typedef typename _Base::const_iterator	_Base_const_iterator;
diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string
index 3793a35..f068ef0 100644
--- a/libstdc++-v3/include/debug/string
+++ b/libstdc++-v3/include/debug/string
@@ -42,12 +42,13 @@ namespace __gnu_debug
     class basic_string
     : public __gnu_debug::_Safe_container<
 	basic_string<_CharT, _Traits, _Allocator>,
-	_Allocator, _Safe_sequence, false>,
+	_Allocator, _Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>,
       public std::basic_string<_CharT, _Traits, _Allocator>
     {
       typedef std::basic_string<_CharT, _Traits, _Allocator>	_Base;
       typedef __gnu_debug::_Safe_container<
-	basic_string, _Allocator, _Safe_sequence, false>	_Safe;
+	basic_string, _Allocator, _Safe_sequence, bool(_GLIBCXX_USE_CXX11_ABI)>
+	_Safe;
 
   public:
     // types:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]