OSDN Git Service

2010-01-03 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 3 Jan 2010 20:30:28 +0000 (20:30 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 3 Jan 2010 20:30:28 +0000 (20:30 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155594 138bc75d-0d04-0410-961f-82ee72b054a4

12 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/debug/list
libstdc++-v3/include/debug/map.h
libstdc++-v3/include/debug/multimap.h
libstdc++-v3/include/debug/multiset.h
libstdc++-v3/include/debug/set.h
libstdc++-v3/include/ext/pb_ds/detail/debug_map_base.hpp
libstdc++-v3/include/profile/map.h
libstdc++-v3/include/profile/multimap.h
libstdc++-v3/include/profile/multiset.h
libstdc++-v3/include/profile/set.h
libstdc++-v3/testsuite/21_strings/basic_string/40160.cc

index f77a301..9186559 100644 (file)
@@ -1,5 +1,22 @@
 2010-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
 
 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
        in C++0x mode.
        * include/debug/bitset (bitset<>::bitset(unsigned long long)):
        * include/profile/bitset (bitset<>::bitset(unsigned long long)): Add
        in C++0x mode.
        * include/debug/bitset (bitset<>::bitset(unsigned long long)):
index 72060e0..3af008c 100644 (file)
@@ -1,6 +1,6 @@
 // Debugging list implementation -*- C++ -*-
 
 // 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
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -395,6 +395,12 @@ namespace __debug
        this->splice(__position, _GLIBCXX_MOVE(__x), __x.begin(), __x.end());
       }
 
        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)
       void
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       splice(iterator __position, list&& __x, iterator __i)
@@ -421,6 +427,12 @@ namespace __debug
                      __i.base());
       }
 
                      __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,
       void
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       splice(iterator __position, list&& __x, iterator __first,
@@ -457,6 +469,12 @@ namespace __debug
                      __first.base(), __last.base());
       }
 
                      __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)
       {
       void
       remove(const _Tp& __value)
       {
@@ -541,6 +559,12 @@ namespace __debug
          }
       }
 
          }
       }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      void
+      merge(list& __x)
+      { merge(std::move(__x)); }
+#endif
+
       template<class _Compare>
         void
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       template<class _Compare>
         void
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
@@ -566,6 +590,13 @@ namespace __debug
            }
        }
 
            }
        }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+      template<typename _Compare>
+        void
+        merge(list& __x, _Compare __comp)
+        { merge(std::move(__x), __comp); }
+#endif
+
       void
       sort() { _Base::sort(); }
 
       void
       sort() { _Base::sort(); }
 
index 2ac21df..9a558b5 100644 (file)
@@ -1,6 +1,6 @@
 // Debugging map implementation -*- C++ -*-
 
 // 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
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -228,6 +228,15 @@ namespace __debug
          _Base::insert(__first, __last);
        }
 
          _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)
       {
       void
       erase(iterator __position)
       {
@@ -235,6 +244,7 @@ namespace __debug
        __position._M_invalidate();
        _Base::erase(__position.base());
       }
        __position._M_invalidate();
        _Base::erase(__position.base());
       }
+#endif
 
       size_type
       erase(const key_type& __x)
 
       size_type
       erase(const key_type& __x)
@@ -250,6 +260,18 @@ namespace __debug
        }
       }
 
        }
       }
 
+#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)
       {
       void
       erase(iterator __first, iterator __last)
       {
@@ -259,6 +281,7 @@ namespace __debug
        while (__first != __last)
          this->erase(__first++);
       }
        while (__first != __last)
          this->erase(__first++);
       }
+#endif
 
       void
       swap(map& __x)
 
       void
       swap(map& __x)
index 3c525b5..f69a289 100644 (file)
@@ -1,6 +1,6 @@
 // Debugging multimap implementation -*- C++ -*-
 
 // 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
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -215,6 +215,15 @@ namespace __debug
          _Base::insert(__first, __last);
        }
 
          _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)
       {
       void
       erase(iterator __position)
       {
@@ -222,6 +231,7 @@ namespace __debug
        __position._M_invalidate();
        _Base::erase(__position.base());
       }
        __position._M_invalidate();
        _Base::erase(__position.base());
       }
+#endif
 
       size_type
       erase(const key_type& __x)
 
       size_type
       erase(const key_type& __x)
@@ -238,6 +248,18 @@ namespace __debug
        return __count;
       }
 
        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)
       {
       void
       erase(iterator __first, iterator __last)
       {
@@ -245,8 +267,9 @@ namespace __debug
        // 151. can't currently clear() empty container
        __glibcxx_check_erase_range(__first, __last);
        while (__first != __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)
 
       void
       swap(multimap& __x)
index 1a15c20..9190982 100644 (file)
@@ -1,6 +1,6 @@
 // Debugging multiset implementation -*- C++ -*-
 
 // 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
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -212,6 +212,15 @@ namespace __debug
       { _Base::insert(__l); }
 #endif
 
       { _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)
       {
       void
       erase(iterator __position)
       {
@@ -219,6 +228,7 @@ namespace __debug
        __position._M_invalidate();
        _Base::erase(__position.base());
       }
        __position._M_invalidate();
        _Base::erase(__position.base());
       }
+#endif
 
       size_type
       erase(const key_type& __x)
 
       size_type
       erase(const key_type& __x)
@@ -235,6 +245,18 @@ namespace __debug
        return __count;
       }
 
        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)
       {
       void
       erase(iterator __first, iterator __last)
       {
@@ -242,8 +264,9 @@ namespace __debug
        // 151. can't currently clear() empty container
        __glibcxx_check_erase_range(__first, __last);
        while (__first != __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)
 
       void
       swap(multiset& __x)
index b822ba9..769639d 100644 (file)
@@ -1,6 +1,6 @@
 // Debugging set implementation -*- C++ -*-
 
 // 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
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -217,6 +217,15 @@ namespace __debug
       { _Base::insert(__l); }
 #endif
 
       { _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)
       {
       void
       erase(iterator __position)
       {
@@ -224,6 +233,7 @@ namespace __debug
        __position._M_invalidate();
        _Base::erase(__position.base());
       }
        __position._M_invalidate();
        _Base::erase(__position.base());
       }
+#endif
 
       size_type
       erase(const key_type& __x)
 
       size_type
       erase(const key_type& __x)
@@ -239,16 +249,28 @@ namespace __debug
         }
       }
 
         }
       }
 
+#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);
       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)
        while (__first != __last)
-        this->erase(__first++);
+         this->erase(__first++);
       }
       }
+#endif
 
       void
       swap(set& __x)
 
       void
       swap(set& __x)
index 2227691..ebe8dc8 100644 (file)
@@ -1,6 +1,7 @@
 // -*- C++ -*-
 
 // -*- 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
 //
 // 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
@@ -153,9 +154,10 @@ namespace __gnu_pbds
     insert_new(const_key_reference r_key)
     {
       _GLIBCXX_DEBUG_ONLY(assert_valid();)
     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;
       if (find(r_key) != m_key_set.end())
        {
          std::cerr << "insert_new" << r_key << std::endl;
@@ -171,7 +173,7 @@ namespace __gnu_pbds
          std::cerr << "insert_new" << r_key << std::endl;
          std::abort();
        }
          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();)
     }
 
       _GLIBCXX_DEBUG_ONLY(assert_valid();)
     }
 
@@ -314,9 +316,10 @@ namespace __gnu_pbds
     PB_DS_CLASS_C_DEC::
     split(const_key_reference r_key, Cmp_Fn cmp_fn, PB_DS_CLASS_C_DEC& other)
     {
     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())
       other.clear();
       key_set_iterator it = m_key_set.begin();
       while (it != m_key_set.end())
@@ -327,7 +330,7 @@ namespace __gnu_pbds
          }
         else
          ++it;
          }
         else
          ++it;
-      alloc.set_probability(orig_throw_prob);
+      // alloc.set_probability(orig_throw_prob);
     }
 
     PB_DS_CLASS_T_DEC
     }
 
     PB_DS_CLASS_T_DEC
@@ -335,9 +338,10 @@ namespace __gnu_pbds
     PB_DS_CLASS_C_DEC::
     join(PB_DS_CLASS_C_DEC& other)
     {
     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())
        {
       key_set_iterator it = other.m_key_set.begin();
       while (it != other.m_key_set.end())
        {
@@ -345,7 +349,7 @@ namespace __gnu_pbds
          it = other.m_key_set.erase(it);
        }
       _GLIBCXX_DEBUG_ASSERT(other.m_key_set.empty());
          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
     }
 
 #undef PB_DS_CLASS_T_DEC
index 0197d45..baa877d 100644 (file)
@@ -1,6 +1,6 @@
 // Profiling map implementation -*- C++ -*-
 
 // 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
 //
 // 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
@@ -307,6 +307,17 @@ namespace __profile
        }
       }
 
        }
       }
 
+#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)
       {
       void
       erase(iterator __first, iterator __last)
       {
@@ -315,6 +326,7 @@ namespace __profile
        while (__first != __last)
          this->erase(__first++);
       }
        while (__first != __last)
          this->erase(__first++);
       }
+#endif
 
       void
 
 
       void
 
index 9a65a93..df4e02d 100644 (file)
@@ -206,15 +206,11 @@ namespace __profile
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       iterator
       erase(iterator __position)
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       iterator
       erase(iterator __position)
-      {
-        return _Base::erase(__position);
-      }
+      { return _Base::erase(__position); }
 #else
       void
       erase(iterator __position)
 #else
       void
       erase(iterator __position)
-      {
-       _Base::erase(__position);
-      }
+      { _Base::erase(__position); }
 #endif
 
       size_type
 #endif
 
       size_type
@@ -231,14 +227,26 @@ namespace __profile
        return __count;
       }
 
        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)
       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)
 
       void
       swap(multimap& __x)
index 69a11f4..b44abc4 100644 (file)
@@ -1,6 +1,6 @@
 // Profiling multiset implementation -*- C++ -*-
 
 // 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
 //
 // 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
@@ -204,15 +204,11 @@ namespace __profile
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       iterator
       erase(iterator __position)
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       iterator
       erase(iterator __position)
-      {
-        return _Base::erase(__position);
-      }
+      { return _Base::erase(__position); }
 #else
       void
       erase(iterator __position)
 #else
       void
       erase(iterator __position)
-      {
-       _Base::erase(__position);
-      }
+      { _Base::erase(__position); }
 #endif
 
       size_type
 #endif
 
       size_type
@@ -229,14 +225,26 @@ namespace __profile
        return __count;
       }
 
        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)
       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)
 
       void
       swap(multiset& __x)
index af249a2..6c6773c 100644 (file)
@@ -1,6 +1,6 @@
 // Profiling set implementation -*- C++ -*-
 
 // 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
 //
 // 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
@@ -209,15 +209,11 @@ namespace __profile
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       iterator
       erase(iterator __position)
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       iterator
       erase(iterator __position)
-      {
-        return _Base::erase(__position);
-      }
+      { return _Base::erase(__position); }
 #else
       void
       erase(iterator __position)
 #else
       void
       erase(iterator __position)
-      {
-       _Base::erase(__position);
-      }
+      { _Base::erase(__position); }
 #endif
 
       size_type
 #endif
 
       size_type
@@ -233,14 +229,26 @@ namespace __profile
         }
       }
 
         }
       }
 
+#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)
       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)
 
       void
       swap(set& __x)
index 5472a75..5a746f1 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 
 // -*- 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
 //
 // 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
@@ -17,7 +17,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
 // 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
 // { dg-do compile }
 
 // libstdc++/40160