+2010-01-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/debug/set.h: Implement DR 130 here too.
+ * include/debug/multiset.h: Likewise.
+ * include/debug/map.h: Likewise.
+ * include/debug/multimap.h: Likewise.
+ * include/profile/set.h: Implement DR 130 fully.
+ * include/profile/multiset.h: Likewise.
+ * include/profile/map.h: Likewise.
+ * include/profile/multimap.h: Likewise.
+ * include/debug/list: Implement DR 1133 here too.
+ * include/ext/pb_ds/detail/debug_map_base.hpp: Comment out for
+ now uses of __gnu_cxx::throw_allocator.
+ * testsuite/21_strings/basic_string/40160.cc: Don't pass
+ explicitly -D_GLIBCXX_DEBUG, doesn't play well with profile-mode
+ testing.
+
2010-01-03 Paolo Carlini <paolo.carlini@oracle.com>
* include/profile/bitset (bitset<>::bitset(unsigned long long)): Add
// Debugging list implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
this->splice(__position, _GLIBCXX_MOVE(__x), __x.begin(), __x.end());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ splice(iterator __position, list& __x)
+ { splice(__position, std::move(__x)); }
+#endif
+
void
#ifdef __GXX_EXPERIMENTAL_CXX0X__
splice(iterator __position, list&& __x, iterator __i)
__i.base());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ splice(iterator __position, list& __x, iterator __i)
+ { splice(__position, std::move(__x), __i); }
+#endif
+
void
#ifdef __GXX_EXPERIMENTAL_CXX0X__
splice(iterator __position, list&& __x, iterator __first,
__first.base(), __last.base());
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ splice(iterator __position, list& __x, iterator __first, iterator __last)
+ { splice(__position, std::move(__x), __first, __last); }
+#endif
+
void
remove(const _Tp& __value)
{
}
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ void
+ merge(list& __x)
+ { merge(std::move(__x)); }
+#endif
+
template<class _Compare>
void
#ifdef __GXX_EXPERIMENTAL_CXX0X__
}
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ template<typename _Compare>
+ void
+ merge(list& __x, _Compare __comp)
+ { merge(std::move(__x), __comp); }
+#endif
+
void
sort() { _Base::sort(); }
// Debugging map implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
_Base::insert(__first, __last);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+#else
void
erase(iterator __position)
{
__position._M_invalidate();
_Base::erase(__position.base());
}
+#endif
size_type
erase(const key_type& __x)
}
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ return __last;
+ }
+#else
void
erase(iterator __first, iterator __last)
{
while (__first != __last)
this->erase(__first++);
}
+#endif
void
swap(map& __x)
// Debugging multimap implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
_Base::insert(__first, __last);
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+#else
void
erase(iterator __position)
{
__position._M_invalidate();
_Base::erase(__position.base());
}
+#endif
size_type
erase(const key_type& __x)
return __count;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ return __last;
+ }
+#else
void
erase(iterator __first, iterator __last)
{
// 151. can't currently clear() empty container
__glibcxx_check_erase_range(__first, __last);
while (__first != __last)
- this->erase(__first++);
+ this->erase(__first++);
}
+#endif
void
swap(multimap& __x)
// Debugging multiset implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
{ _Base::insert(__l); }
#endif
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+#else
void
erase(iterator __position)
{
__position._M_invalidate();
_Base::erase(__position.base());
}
+#endif
size_type
erase(const key_type& __x)
return __count;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ return __last;
+ }
+#else
void
erase(iterator __first, iterator __last)
{
// 151. can't currently clear() empty container
__glibcxx_check_erase_range(__first, __last);
while (__first != __last)
- this->erase(__first++);
+ this->erase(__first++);
}
+#endif
void
swap(multiset& __x)
// Debugging set implementation -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
{ _Base::insert(__l); }
#endif
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+#else
void
erase(iterator __position)
{
__position._M_invalidate();
_Base::erase(__position.base());
}
+#endif
size_type
erase(const key_type& __x)
}
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ return __last;
+ }
+#else
void
erase(iterator __first, iterator __last)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 151. can't currently clear() empty container
__glibcxx_check_erase_range(__first, __last);
-
while (__first != __last)
- this->erase(__first++);
+ this->erase(__first++);
}
+#endif
void
swap(set& __x)
// -*- C++ -*-
-// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
insert_new(const_key_reference r_key)
{
_GLIBCXX_DEBUG_ONLY(assert_valid();)
- __gnu_cxx::throw_allocator<char> alloc;
- const double orig_throw_prob = alloc.get_probability();
- alloc.set_probability(0);
+ // XXX FIXME: Adapt for __gnu_cxx::throw_allocator_random.
+ //__gnu_cxx::throw_allocator<char> alloc;
+ // const double orig_throw_prob = alloc.get_probability();
+ // alloc.set_probability(0);
if (find(r_key) != m_key_set.end())
{
std::cerr << "insert_new" << r_key << std::endl;
std::cerr << "insert_new" << r_key << std::endl;
std::abort();
}
- alloc.set_probability(orig_throw_prob);
+ // alloc.set_probability(orig_throw_prob);
_GLIBCXX_DEBUG_ONLY(assert_valid();)
}
PB_DS_CLASS_C_DEC::
split(const_key_reference r_key, Cmp_Fn cmp_fn, PB_DS_CLASS_C_DEC& other)
{
- __gnu_cxx::throw_allocator<char> alloc;
- const double orig_throw_prob = alloc.get_probability();
- alloc.set_probability(0);
+ // XXX FIXME: Adapt for __gnu_cxx::throw_allocator_random.
+ // __gnu_cxx::throw_allocator<char> alloc;
+ // const double orig_throw_prob = alloc.get_probability();
+ // alloc.set_probability(0);
other.clear();
key_set_iterator it = m_key_set.begin();
while (it != m_key_set.end())
}
else
++it;
- alloc.set_probability(orig_throw_prob);
+ // alloc.set_probability(orig_throw_prob);
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
join(PB_DS_CLASS_C_DEC& other)
{
- __gnu_cxx::throw_allocator<char> alloc;
- const double orig_throw_prob = alloc.get_probability();
- alloc.set_probability(0);
+ // XXX FIXME: Adapt for __gnu_cxx::throw_allocator_random.
+ // __gnu_cxx::throw_allocator<char> alloc;
+ // const double orig_throw_prob = alloc.get_probability();
+ // alloc.set_probability(0);
key_set_iterator it = other.m_key_set.begin();
while (it != other.m_key_set.end())
{
it = other.m_key_set.erase(it);
}
_GLIBCXX_DEBUG_ASSERT(other.m_key_set.empty());
- alloc.set_probability(orig_throw_prob);
+ // alloc.set_probability(orig_throw_prob);
}
#undef PB_DS_CLASS_T_DEC
// Profiling map implementation -*- C++ -*-
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
}
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ while (__first != __last)
+ this->erase(__first++);
+ return __last;
+ }
+#else
void
erase(iterator __first, iterator __last)
{
while (__first != __last)
this->erase(__first++);
}
+#endif
void
#ifdef __GXX_EXPERIMENTAL_CXX0X__
iterator
erase(iterator __position)
- {
- return _Base::erase(__position);
- }
+ { return _Base::erase(__position); }
#else
void
erase(iterator __position)
- {
- _Base::erase(__position);
- }
+ { _Base::erase(__position); }
#endif
size_type
return __count;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ while (__first != __last)
+ this->erase(__first++);
+ return __last;
+ }
+#else
void
erase(iterator __first, iterator __last)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 151. can't currently clear() empty container
while (__first != __last)
- this->erase(__first++);
+ this->erase(__first++);
}
+#endif
void
swap(multimap& __x)
// Profiling multiset implementation -*- C++ -*-
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#ifdef __GXX_EXPERIMENTAL_CXX0X__
iterator
erase(iterator __position)
- {
- return _Base::erase(__position);
- }
+ { return _Base::erase(__position); }
#else
void
erase(iterator __position)
- {
- _Base::erase(__position);
- }
+ { _Base::erase(__position); }
#endif
size_type
return __count;
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ while (__first != __last)
+ this->erase(__first++);
+ return __last;
+ }
+#else
void
erase(iterator __first, iterator __last)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 151. can't currently clear() empty container
while (__first != __last)
- this->erase(__first++);
+ this->erase(__first++);
}
+#endif
void
swap(multiset& __x)
// Profiling set implementation -*- C++ -*-
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#ifdef __GXX_EXPERIMENTAL_CXX0X__
iterator
erase(iterator __position)
- {
- return _Base::erase(__position);
- }
+ { return _Base::erase(__position); }
#else
void
erase(iterator __position)
- {
- _Base::erase(__position);
- }
+ { _Base::erase(__position); }
#endif
size_type
}
}
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ while (__first != __last)
+ this->erase(__first++);
+ return __last;
+ }
+#else
void
erase(iterator __first, iterator __last)
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 151. can't currently clear() empty container
while (__first != __last)
- this->erase(__first++);
+ this->erase(__first++);
}
+#endif
void
swap(set& __x)
// -*- C++ -*-
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-options "-fno-rtti -D_GLIBCXX_DEBUG" }
+// { dg-options "-fno-rtti" }
// { dg-do compile }
// libstdc++/40160