c++config (_GLIBCXX_DEPRECATED, [...]): New.
authorBenjamin Kosnik <bkoz@redhat.com>
Mon, 29 Oct 2007 21:13:23 +0000 (21:13 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Mon, 29 Oct 2007 21:13:23 +0000 (21:13 +0000)
2007-10-29  Benjamin Kosnik  <bkoz@redhat.com>

* include/bits/c++config (_GLIBCXX_DEPRECATED,
_GLIBCXX_USE_DEPRECATED): New. Adjust comments.
* include/bits/stl_auto_ptr.h: Move...
* includse/backward/auto_ptr.h: ...here.
* include/bits/stl_function.h (binder1st, binder2nd, bind1st,
bind2nd): Move...
* include/backward/binders.h: ...here. Deprecate in C++0x.

* include/tr1_impl/boost_shared_ptr.h: Guard auto_ptr usage.
* include/std/memory: Same.
* include/std/streambuf: Consistent use of _GLIBCXX_USE_DEPRECATED.

* include/backward/strstream: Fix guard macros.
* include/backward/backward_warning.h: Adjust for all new items.

* config/abi/pre/gnu.ver: Export basic_streambuf::stossc.

* include/Makefile.am (backward_headers): Adjust.
* include/Makefile.in: Regenerate.
* configure: Regenerate.

From-SVN: r129733

14 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/backward/auto_ptr.h [new file with mode: 0644]
libstdc++-v3/include/backward/backward_warning.h
libstdc++-v3/include/backward/binders.h [new file with mode: 0644]
libstdc++-v3/include/backward/strstream
libstdc++-v3/include/bits/c++config
libstdc++-v3/include/bits/stl_auto_ptr.h [deleted file]
libstdc++-v3/include/bits/stl_function.h
libstdc++-v3/include/std/memory
libstdc++-v3/include/std/streambuf
libstdc++-v3/include/tr1_impl/boost_shared_ptr.h

index 904c253a6a8e7f28fd5fc0eab3bee6dac1a0267e..cbaf73ddcd81c138ce49e86499dee6e17a6048e6 100644 (file)
@@ -1,3 +1,26 @@
+2007-10-29  Benjamin Kosnik  <bkoz@redhat.com>
+       * include/bits/c++config (_GLIBCXX_DEPRECATED,
+       _GLIBCXX_USE_DEPRECATED): New. Adjust comments.
+       * include/bits/stl_auto_ptr.h: Move...
+       * includse/backward/auto_ptr.h: ...here.
+       * include/bits/stl_function.h (binder1st, binder2nd, bind1st,
+       bind2nd): Move...
+       * include/backward/binders.h: ...here. Deprecate in C++0x.
+
+       * include/tr1_impl/boost_shared_ptr.h: Guard auto_ptr usage.
+       * include/std/memory: Same.
+       * include/std/streambuf: Consistent use of _GLIBCXX_USE_DEPRECATED.
+
+       * include/backward/strstream: Fix guard macros.
+       * include/backward/backward_warning.h: Adjust for all new items.
+
+       * config/abi/pre/gnu.ver: Export basic_streambuf::stossc.
+       
+       * include/Makefile.am (backward_headers): Adjust.
+       * include/Makefile.in: Regenerate.
+       * configure: Regenerate.
+
 2007-10-29  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/Makefile.am (ext_compat_headers): New.
index cc6252e91c7d64dc5d620ed716c2cb215ec0036e..87cc92ec5ad73400c52a33bd3a82a870aaaa59e1 100644 (file)
@@ -48,7 +48,7 @@ GLIBCXX_3.4 {
       std::basic_ostr[a-d]*;
       std::basic_ostr[f-z]*;
       std::basic_[p-r]*;
-      std::basic_streambuf*;
+#     std::basic_streambuf
 #     std::basic_string
 #     std::basic_stringbuf
       std::basic_stringstream*;
@@ -233,6 +233,13 @@ GLIBCXX_3.4 {
     _ZNKSbIwSt11char_traitsIwESaIwEE9_M_ibeginEv;
     _ZStplIwSt11char_traitsIwESaIwEESbIT_T0_T1_E*;
 
+    # std::basic_streambuf
+    _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE[CD]*;
+    _ZNKSt15basic_streambufI[cw]St11char_traitsI[cw]EE[0-9]*;
+    _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE[0-9][a-z][^t]*;
+    _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE[0-9][0-9][a-z][^t]*;
+    _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EEaSERKS2_;
+
     # std::basic_stringbuf
     _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[CD]*;
     _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE[0-9][a-r]*;
@@ -777,6 +784,8 @@ GLIBCXX_3.4.10 {
     _ZNSt9__cxx199815_List_node_base7reverseEv;
     _ZNSt9__cxx199815_List_node_base8transfer*;
 
+    _ZNSt15basic_streambufI[cw]St11char_traitsI[cw]EE6stosscEv;
+
 } GLIBCXX_3.4.9;
 
 # Symbols in the support library (libsupc++) have their own tag.
index c1b549badd4a1a0c3d8e6396323dbc2e4e304780..b3d12571097deb101ca1a2869d87745d6de9b364 100644 (file)
@@ -119,7 +119,6 @@ bits_headers = \
        ${bits_srcdir}/stl_iterator_base_types.h \
        ${bits_srcdir}/stl_list.h \
        ${bits_srcdir}/stl_map.h \
-       ${bits_srcdir}/stl_auto_ptr.h \
        ${bits_srcdir}/stl_move.h \
        ${bits_srcdir}/stl_multimap.h \
        ${bits_srcdir}/stl_multiset.h \
@@ -145,12 +144,14 @@ bits_headers = \
 backward_srcdir = ${glibcxx_srcdir}/include/backward
 backward_builddir = ./backward
 backward_headers = \
-       ${backward_srcdir}/strstream \
+       ${backward_srcdir}/auto_ptr.h \
+       ${backward_srcdir}/backward_warning.h \
+       ${backward_srcdir}/binders.h \
        ${backward_srcdir}/hash_map \
        ${backward_srcdir}/hash_set \
        ${backward_srcdir}/hash_fun.h \
        ${backward_srcdir}/hashtable.h \
-       ${backward_srcdir}/backward_warning.h
+       ${backward_srcdir}/strstream 
 
 pb_srcdir = ${glibcxx_srcdir}/include/ext/pb_ds
 pb_builddir = ./ext/pb_ds
index b08e447017b9d8fd144909a46f61022ad7819f24..5a70ed136e8cdd994754e2a77ca57636ebe95d30 100644 (file)
@@ -368,7 +368,6 @@ bits_headers = \
        ${bits_srcdir}/stl_iterator_base_types.h \
        ${bits_srcdir}/stl_list.h \
        ${bits_srcdir}/stl_map.h \
-       ${bits_srcdir}/stl_auto_ptr.h \
        ${bits_srcdir}/stl_move.h \
        ${bits_srcdir}/stl_multimap.h \
        ${bits_srcdir}/stl_multiset.h \
@@ -394,12 +393,14 @@ bits_headers = \
 backward_srcdir = ${glibcxx_srcdir}/include/backward
 backward_builddir = ./backward
 backward_headers = \
-       ${backward_srcdir}/strstream \
+       ${backward_srcdir}/auto_ptr.h \
+       ${backward_srcdir}/backward_warning.h \
+       ${backward_srcdir}/binders.h \
        ${backward_srcdir}/hash_map \
        ${backward_srcdir}/hash_set \
        ${backward_srcdir}/hash_fun.h \
        ${backward_srcdir}/hashtable.h \
-       ${backward_srcdir}/backward_warning.h
+       ${backward_srcdir}/strstream 
 
 pb_srcdir = ${glibcxx_srcdir}/include/ext/pb_ds
 pb_builddir = ./ext/pb_ds
diff --git a/libstdc++-v3/include/backward/auto_ptr.h b/libstdc++-v3/include/backward/auto_ptr.h
new file mode 100644 (file)
index 0000000..3be41d1
--- /dev/null
@@ -0,0 +1,301 @@
+// auto_ptr implementation -*- C++ -*-
+
+// Copyright (C) 2007 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 of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/** @file backward/auto_ptr.h
+ *  This is an internal header file, included by other library headers.
+ *  You should not attempt to use it directly.
+ */
+
+#ifndef _STL_AUTO_PTR_H
+#define _STL_AUTO_PTR_H 1
+
+#include <bits/c++config.h>
+#include <debug/debug.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+  /**
+   *  A wrapper class to provide auto_ptr with reference semantics.
+   *  For example, an auto_ptr can be assigned (or constructed from)
+   *  the result of a function which returns an auto_ptr by value.
+   *
+   *  All the auto_ptr_ref stuff should happen behind the scenes.
+   */
+  template<typename _Tp1>
+    struct auto_ptr_ref
+    {
+      _Tp1* _M_ptr;
+      
+      explicit
+      auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
+    } _GLIBCXX_DEPRECATED;
+
+
+  /**
+   *  @brief  A simple smart pointer providing strict ownership semantics.
+   *
+   *  The Standard says:
+   *  <pre>
+   *  An @c auto_ptr owns the object it holds a pointer to.  Copying
+   *  an @c auto_ptr copies the pointer and transfers ownership to the
+   *  destination.  If more than one @c auto_ptr owns the same object
+   *  at the same time the behavior of the program is undefined.
+   *
+   *  The uses of @c auto_ptr include providing temporary
+   *  exception-safety for dynamically allocated memory, passing
+   *  ownership of dynamically allocated memory to a function, and
+   *  returning dynamically allocated memory from a function.  @c
+   *  auto_ptr does not meet the CopyConstructible and Assignable
+   *  requirements for Standard Library <a
+   *  href="tables.html#65">container</a> elements and thus
+   *  instantiating a Standard Library container with an @c auto_ptr
+   *  results in undefined behavior.
+   *  </pre>
+   *  Quoted from [20.4.5]/3.
+   *
+   *  Good examples of what can and cannot be done with auto_ptr can
+   *  be found in the libstdc++ testsuite.
+   *
+   *  @if maint
+   *  _GLIBCXX_RESOLVE_LIB_DEFECTS
+   *  127.  auto_ptr<> conversion issues
+   *  These resolutions have all been incorporated.
+   *  @endif
+   */
+  template<typename _Tp>
+    class auto_ptr
+    {
+    private:
+      _Tp* _M_ptr;
+      
+    public:
+      /// The pointed-to type.
+      typedef _Tp element_type;
+      
+      /**
+       *  @brief  An %auto_ptr is usually constructed from a raw pointer.
+       *  @param  p  A pointer (defaults to NULL).
+       *
+       *  This object now @e owns the object pointed to by @a p.
+       */
+      explicit
+      auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
+
+      /**
+       *  @brief  An %auto_ptr can be constructed from another %auto_ptr.
+       *  @param  a  Another %auto_ptr of the same type.
+       *
+       *  This object now @e owns the object previously owned by @a a,
+       *  which has given up ownsership.
+       */
+      auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
+
+      /**
+       *  @brief  An %auto_ptr can be constructed from another %auto_ptr.
+       *  @param  a  Another %auto_ptr of a different but related type.
+       *
+       *  A pointer-to-Tp1 must be convertible to a
+       *  pointer-to-Tp/element_type.
+       *
+       *  This object now @e owns the object previously owned by @a a,
+       *  which has given up ownsership.
+       */
+      template<typename _Tp1>
+        auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
+
+      /**
+       *  @brief  %auto_ptr assignment operator.
+       *  @param  a  Another %auto_ptr of the same type.
+       *
+       *  This object now @e owns the object previously owned by @a a,
+       *  which has given up ownsership.  The object that this one @e
+       *  used to own and track has been deleted.
+       */
+      auto_ptr&
+      operator=(auto_ptr& __a) throw()
+      {
+       reset(__a.release());
+       return *this;
+      }
+
+      /**
+       *  @brief  %auto_ptr assignment operator.
+       *  @param  a  Another %auto_ptr of a different but related type.
+       *
+       *  A pointer-to-Tp1 must be convertible to a pointer-to-Tp/element_type.
+       *
+       *  This object now @e owns the object previously owned by @a a,
+       *  which has given up ownsership.  The object that this one @e
+       *  used to own and track has been deleted.
+       */
+      template<typename _Tp1>
+        auto_ptr&
+        operator=(auto_ptr<_Tp1>& __a) throw()
+        {
+         reset(__a.release());
+         return *this;
+       }
+
+      /**
+       *  When the %auto_ptr goes out of scope, the object it owns is
+       *  deleted.  If it no longer owns anything (i.e., @c get() is
+       *  @c NULL), then this has no effect.
+       *
+       *  @if maint
+       *  The C++ standard says there is supposed to be an empty throw
+       *  specification here, but omitting it is standard conforming.  Its
+       *  presence can be detected only if _Tp::~_Tp() throws, but this is
+       *  prohibited.  [17.4.3.6]/2
+       *  @endif
+       */
+      ~auto_ptr() { delete _M_ptr; }
+      
+      /**
+       *  @brief  Smart pointer dereferencing.
+       *
+       *  If this %auto_ptr no longer owns anything, then this
+       *  operation will crash.  (For a smart pointer, "no longer owns
+       *  anything" is the same as being a null pointer, and you know
+       *  what happens when you dereference one of those...)
+       */
+      element_type&
+      operator*() const throw() 
+      {
+       _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+       return *_M_ptr; 
+      }
+      
+      /**
+       *  @brief  Smart pointer dereferencing.
+       *
+       *  This returns the pointer itself, which the language then will
+       *  automatically cause to be dereferenced.
+       */
+      element_type*
+      operator->() const throw() 
+      {
+       _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+       return _M_ptr; 
+      }
+      
+      /**
+       *  @brief  Bypassing the smart pointer.
+       *  @return  The raw pointer being managed.
+       *
+       *  You can get a copy of the pointer that this object owns, for
+       *  situations such as passing to a function which only accepts
+       *  a raw pointer.
+       *
+       *  @note  This %auto_ptr still owns the memory.
+       */
+      element_type*
+      get() const throw() { return _M_ptr; }
+      
+      /**
+       *  @brief  Bypassing the smart pointer.
+       *  @return  The raw pointer being managed.
+       *
+       *  You can get a copy of the pointer that this object owns, for
+       *  situations such as passing to a function which only accepts
+       *  a raw pointer.
+       *
+       *  @note  This %auto_ptr no longer owns the memory.  When this object
+       *  goes out of scope, nothing will happen.
+       */
+      element_type*
+      release() throw()
+      {
+       element_type* __tmp = _M_ptr;
+       _M_ptr = 0;
+       return __tmp;
+      }
+      
+      /**
+       *  @brief  Forcibly deletes the managed object.
+       *  @param  p  A pointer (defaults to NULL).
+       *
+       *  This object now @e owns the object pointed to by @a p.  The
+       *  previous object has been deleted.
+       */
+      void
+      reset(element_type* __p = 0) throw()
+      {
+       if (__p != _M_ptr)
+         {
+           delete _M_ptr;
+           _M_ptr = __p;
+         }
+      }
+      
+      /** 
+       *  @brief  Automatic conversions
+       *
+       *  These operations convert an %auto_ptr into and from an auto_ptr_ref
+       *  automatically as needed.  This allows constructs such as
+       *  @code
+       *    auto_ptr<Derived>  func_returning_auto_ptr(.....);
+       *    ...
+       *    auto_ptr<Base> ptr = func_returning_auto_ptr(.....);
+       *  @endcode
+       */
+      auto_ptr(auto_ptr_ref<element_type> __ref) throw()
+      : _M_ptr(__ref._M_ptr) { }
+      
+      auto_ptr&
+      operator=(auto_ptr_ref<element_type> __ref) throw()
+      {
+       if (__ref._M_ptr != this->get())
+         {
+           delete _M_ptr;
+           _M_ptr = __ref._M_ptr;
+         }
+       return *this;
+      }
+      
+      template<typename _Tp1>
+        operator auto_ptr_ref<_Tp1>() throw()
+        { return auto_ptr_ref<_Tp1>(this->release()); }
+
+      template<typename _Tp1>
+        operator auto_ptr<_Tp1>() throw()
+        { return auto_ptr<_Tp1>(this->release()); }
+    } _GLIBCXX_DEPRECATED;
+
+  // _GLIBCXX_RESOLVE_LIB_DEFECTS
+  // 541. shared_ptr template assignment and void
+  template<>
+    class auto_ptr<void>
+    {
+    public:
+      typedef void element_type;
+    } _GLIBCXX_DEPRECATED;
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _STL_AUTO_PTR_H */
index 5954bd029535621529ecfbbc7515d9412592c7a6..01371a7db0da6a79386ba2a73d6755e0c6450877 100644 (file)
 
 #ifdef __DEPRECATED
 #warning This file includes at least one deprecated or antiquated header. \
-  Please consider the use of alternate interfaces as follows: \
-  <sstream>            basic_stringbuf         <strstream>     strstreambuf \
-  <sstream>            basic_istringstream     <strstream>     istrstream \
-  <sstream>            basic_ostringstream     <strstream>     ostrstream \
-  <sstream>            basic_stringstream      <strstream>     strstream \
-  <unordered_set>      unordered_set           <ext/hash_set>  hash_set \
-  <unordered_set>      unordered_multiset      <ext/hash_set>  hash_multiset \
-  <unordered_map>      unordered_map           <ext/hash_set>  hash_map \
-  <unordered_map>      unordered_multimap      <ext/hash_set>  hash_multimap \
+  Please consider use of an equivalent, non-deprecated interface for the  \
+  requested functionality. A list of valid replacements is as follows:   \
+                                                                          \
+  Use:                                 Instead of:                       \
+  <sstream>, basic_stringbuf           <strstream>, strstreambuf         \
+  <sstream>, basic_istringstream       <strstream>, istrstream           \
+  <sstream>, basic_ostringstream       <strstream>, ostrstream           \
+  <sstream>, basic_stringstream                <strstream>, strstream            \
+  <unordered_set>, unordered_set               <ext/hash_set>, hash_set          \
+  <unordered_set>, unordered_multiset  <ext/hash_set>, hash_multiset     \
+  <unordered_map>, unordered_map       <ext/hash_set>, hash_map          \
+  <unordered_map>, unordered_multimap  <ext/hash_set>, hash_multimap     \
+  <functional>, bind                   <functional>, binder1st           \
+  <functional>, bind                   <functional>, binder2nd           \
+  <functional>, bind                   <functional>, bind1st             \
+  <functional>, bind                   <functional>, bind2nd             \
+  <memory>, unique_ptr                 <memory>, auto_ptr                \
+                                                                          \
   To disable this warning use -Wno-deprecated.
 #endif
 
diff --git a/libstdc++-v3/include/backward/binders.h b/libstdc++-v3/include/backward/binders.h
new file mode 100644 (file)
index 0000000..313bffc
--- /dev/null
@@ -0,0 +1,171 @@
+// Functor implementations -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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 of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996-1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+/** @file backward/binders.h
+ *  This is an internal header file, included by other library headers.
+ *  You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_BINDERS_H
+#define _GLIBCXX_BINDERS_H 1
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+  // 20.3.6 binders
+  /** @defgroup s20_3_6_binder Binder Classes
+   *  Binders turn functions/functors with two arguments into functors with
+   *  a single argument, storing an argument to be applied later.  For
+   *  example, a variable @c B of type @c binder1st is constructed from a
+   *  functor @c f and an argument @c x.  Later, B's @c operator() is called
+   *  with a single argument @c y.  The return value is the value of @c f(x,y).
+   *  @c B can be "called" with various arguments (y1, y2, ...) and will in
+   *  turn call @c f(x,y1), @c f(x,y2), ...
+   *
+   *  The function @c bind1st is provided to save some typing.  It takes the
+   *  function and an argument as parameters, and returns an instance of
+   *  @c binder1st.
+   *
+   *  The type @c binder2nd and its creator function @c bind2nd do the same
+   *  thing, but the stored argument is passed as the second parameter instead
+   *  of the first, e.g., @c bind2nd(std::minus<float>,1.3) will create a
+   *  functor whose @c operator() accepts a floating-point number, subtracts
+   *  1.3 from it, and returns the result.  (If @c bind1st had been used,
+   *  the functor would perform "1.3 - x" instead.
+   *
+   *  Creator-wrapper functions like @c bind1st are intended to be used in
+   *  calling algorithms.  Their return values will be temporary objects.
+   *  (The goal is to not require you to type names like
+   *  @c std::binder1st<std::plus<int>> for declaring a variable to hold the
+   *  return value from @c bind1st(std::plus<int>,5).
+   *
+   *  These become more useful when combined with the composition functions.
+   *
+   *  @{
+   */
+  /// One of the @link s20_3_6_binder binder functors@endlink.
+  template<typename _Operation>
+    class binder1st
+    : public unary_function<typename _Operation::second_argument_type,
+                           typename _Operation::result_type>
+    {
+    protected:
+      _Operation op;
+      typename _Operation::first_argument_type value;
+
+    public:
+      binder1st(const _Operation& __x,
+               const typename _Operation::first_argument_type& __y)
+      : op(__x), value(__y) { }
+
+      typename _Operation::result_type
+      operator()(const typename _Operation::second_argument_type& __x) const
+      { return op(value, __x); }
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 109.  Missing binders for non-const sequence elements
+      typename _Operation::result_type
+      operator()(typename _Operation::second_argument_type& __x) const
+      { return op(value, __x); }
+    } _GLIBCXX_DEPRECATED;
+
+  /// One of the @link s20_3_6_binder binder functors@endlink.
+  template<typename _Operation, typename _Tp>
+    inline binder1st<_Operation>
+    bind1st(const _Operation& __fn, const _Tp& __x)
+    {
+      typedef typename _Operation::first_argument_type _Arg1_type;
+      return binder1st<_Operation>(__fn, _Arg1_type(__x));
+    }
+
+  /// One of the @link s20_3_6_binder binder functors@endlink.
+  template<typename _Operation>
+    class binder2nd
+    : public unary_function<typename _Operation::first_argument_type,
+                           typename _Operation::result_type>
+    {
+    protected:
+      _Operation op;
+      typename _Operation::second_argument_type value;
+
+    public:
+      binder2nd(const _Operation& __x,
+               const typename _Operation::second_argument_type& __y)
+      : op(__x), value(__y) { }
+
+      typename _Operation::result_type
+      operator()(const typename _Operation::first_argument_type& __x) const
+      { return op(__x, value); }
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 109.  Missing binders for non-const sequence elements
+      typename _Operation::result_type
+      operator()(typename _Operation::first_argument_type& __x) const
+      { return op(__x, value); }
+    } _GLIBCXX_DEPRECATED;
+
+  /// One of the @link s20_3_6_binder binder functors@endlink.
+  template<typename _Operation, typename _Tp>
+    inline binder2nd<_Operation>
+    bind2nd(const _Operation& __fn, const _Tp& __x)
+    {
+      typedef typename _Operation::second_argument_type _Arg2_type;
+      return binder2nd<_Operation>(__fn, _Arg2_type(__x));
+    } 
+  /** @}  */
+
+_GLIBCXX_END_NAMESPACE
+
+#endif /* _GLIBCXX_BINDERS_H */
index d0d5a13863f79d4077a97a419969d98b6823e602..18617419c35e95add5606be50b704f2e46bad67b 100644 (file)
 
 // WARNING: The classes defined in this header are DEPRECATED.  This
 // header is defined in section D.7.1 of the C++ standard, and it
-// MAY BE REMOVED in a future standard revision.  You should use the
+// MAY BE REMOVED in a future standard revision.  One should use the
 // header <sstream> instead.
 
-#ifndef __SGI_STL_STRSTREAM
-#define __SGI_STL_STRSTREAM
+#ifndef _GLIBCXX_STRSTREAM
+#define _GLIBCXX_STRSTREAM
 
 #include "backward_warning.h"
 #include <iosfwd>
index 51b8f2dde99326fce1c83965a001e2302863ed3e..58c34733ec8560ee8e68f2614286b55579320764 100644 (file)
@@ -45,7 +45,9 @@
 // The current version of the C++ library in compressed ISO date format.
 #define __GLIBCXX__ 
 
-// Macros for visibility support.
+// Macros for visibility.
+// _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
+// _GLIBCXX_VISIBILITY
 #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
 
 #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY
 # define _GLIBCXX_VISIBILITY(V) 
 #endif
 
+// Macros for deprecated.
+// _GLIBCXX_USE_DEPRECATED
+// _GLIBCXX_DEPRECATED
+#ifndef _GLIBCXX_USE_DEPRECATED
+# define _GLIBCXX_USE_DEPRECATED 1
+#endif
+
+#if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define _GLIBCXX_DEPRECATED
+#endif
+
+// Macros for activating various namespace association modes.
+// _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+// _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+// _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+
 // Guide to libstdc++ namespaces.
 /*
   namespace std
   }
 */
 
-// Macros for activating various namespace association modes.
-// _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
-// _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
-// _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
-
 #ifdef _GLIBCXX_DEBUG
 # define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
 #endif
 # define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
 #endif
 
-// Macros for namespace scope. Either namespace std:: or __gnu_cxx::,
-// or the name of some nested namespace within it.
+// Macros for namespace scope. Either namespace std:: or the name
+// of some nested namespace within it.
 // _GLIBCXX_STD
 // _GLIBCXX_STD_D
 // _GLIBCXX_STD_P
diff --git a/libstdc++-v3/include/bits/stl_auto_ptr.h b/libstdc++-v3/include/bits/stl_auto_ptr.h
deleted file mode 100644 (file)
index 6e0f9c7..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-// auto_ptr implementation -*- C++ -*-
-
-// Copyright (C) 2007 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 of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this library; see the file COPYING.  If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02110-1301, USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-/** @file stl_auto_ptr.h
- *  This is an internal header file, included by other library headers.
- *  You should not attempt to use it directly.
- */
-
-#ifndef _STL_AUTO_PTR_H
-#define _STL_AUTO_PTR_H 1
-
-#include <bits/c++config.h>
-#include <debug/debug.h>
-
-_GLIBCXX_BEGIN_NAMESPACE(std)
-
-  /**
-   *  A wrapper class to provide auto_ptr with reference semantics.
-   *  For example, an auto_ptr can be assigned (or constructed from)
-   *  the result of a function which returns an auto_ptr by value.
-   *
-   *  All the auto_ptr_ref stuff should happen behind the scenes.
-   */
-  template<typename _Tp1>
-    struct auto_ptr_ref
-    {
-      _Tp1* _M_ptr;
-      
-      explicit
-      auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
-    };
-
-
-  /**
-   *  @brief  A simple smart pointer providing strict ownership semantics.
-   *
-   *  The Standard says:
-   *  <pre>
-   *  An @c auto_ptr owns the object it holds a pointer to.  Copying
-   *  an @c auto_ptr copies the pointer and transfers ownership to the
-   *  destination.  If more than one @c auto_ptr owns the same object
-   *  at the same time the behavior of the program is undefined.
-   *
-   *  The uses of @c auto_ptr include providing temporary
-   *  exception-safety for dynamically allocated memory, passing
-   *  ownership of dynamically allocated memory to a function, and
-   *  returning dynamically allocated memory from a function.  @c
-   *  auto_ptr does not meet the CopyConstructible and Assignable
-   *  requirements for Standard Library <a
-   *  href="tables.html#65">container</a> elements and thus
-   *  instantiating a Standard Library container with an @c auto_ptr
-   *  results in undefined behavior.
-   *  </pre>
-   *  Quoted from [20.4.5]/3.
-   *
-   *  Good examples of what can and cannot be done with auto_ptr can
-   *  be found in the libstdc++ testsuite.
-   *
-   *  @if maint
-   *  _GLIBCXX_RESOLVE_LIB_DEFECTS
-   *  127.  auto_ptr<> conversion issues
-   *  These resolutions have all been incorporated.
-   *  @endif
-   */
-  template<typename _Tp>
-    class auto_ptr
-    {
-    private:
-      _Tp* _M_ptr;
-      
-    public:
-      /// The pointed-to type.
-      typedef _Tp element_type;
-      
-      /**
-       *  @brief  An %auto_ptr is usually constructed from a raw pointer.
-       *  @param  p  A pointer (defaults to NULL).
-       *
-       *  This object now @e owns the object pointed to by @a p.
-       */
-      explicit
-      auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
-
-      /**
-       *  @brief  An %auto_ptr can be constructed from another %auto_ptr.
-       *  @param  a  Another %auto_ptr of the same type.
-       *
-       *  This object now @e owns the object previously owned by @a a,
-       *  which has given up ownsership.
-       */
-      auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
-
-      /**
-       *  @brief  An %auto_ptr can be constructed from another %auto_ptr.
-       *  @param  a  Another %auto_ptr of a different but related type.
-       *
-       *  A pointer-to-Tp1 must be convertible to a
-       *  pointer-to-Tp/element_type.
-       *
-       *  This object now @e owns the object previously owned by @a a,
-       *  which has given up ownsership.
-       */
-      template<typename _Tp1>
-        auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
-
-      /**
-       *  @brief  %auto_ptr assignment operator.
-       *  @param  a  Another %auto_ptr of the same type.
-       *
-       *  This object now @e owns the object previously owned by @a a,
-       *  which has given up ownsership.  The object that this one @e
-       *  used to own and track has been deleted.
-       */
-      auto_ptr&
-      operator=(auto_ptr& __a) throw()
-      {
-       reset(__a.release());
-       return *this;
-      }
-
-      /**
-       *  @brief  %auto_ptr assignment operator.
-       *  @param  a  Another %auto_ptr of a different but related type.
-       *
-       *  A pointer-to-Tp1 must be convertible to a pointer-to-Tp/element_type.
-       *
-       *  This object now @e owns the object previously owned by @a a,
-       *  which has given up ownsership.  The object that this one @e
-       *  used to own and track has been deleted.
-       */
-      template<typename _Tp1>
-        auto_ptr&
-        operator=(auto_ptr<_Tp1>& __a) throw()
-        {
-         reset(__a.release());
-         return *this;
-       }
-
-      /**
-       *  When the %auto_ptr goes out of scope, the object it owns is
-       *  deleted.  If it no longer owns anything (i.e., @c get() is
-       *  @c NULL), then this has no effect.
-       *
-       *  @if maint
-       *  The C++ standard says there is supposed to be an empty throw
-       *  specification here, but omitting it is standard conforming.  Its
-       *  presence can be detected only if _Tp::~_Tp() throws, but this is
-       *  prohibited.  [17.4.3.6]/2
-       *  @endif
-       */
-      ~auto_ptr() { delete _M_ptr; }
-      
-      /**
-       *  @brief  Smart pointer dereferencing.
-       *
-       *  If this %auto_ptr no longer owns anything, then this
-       *  operation will crash.  (For a smart pointer, "no longer owns
-       *  anything" is the same as being a null pointer, and you know
-       *  what happens when you dereference one of those...)
-       */
-      element_type&
-      operator*() const throw() 
-      {
-       _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
-       return *_M_ptr; 
-      }
-      
-      /**
-       *  @brief  Smart pointer dereferencing.
-       *
-       *  This returns the pointer itself, which the language then will
-       *  automatically cause to be dereferenced.
-       */
-      element_type*
-      operator->() const throw() 
-      {
-       _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
-       return _M_ptr; 
-      }
-      
-      /**
-       *  @brief  Bypassing the smart pointer.
-       *  @return  The raw pointer being managed.
-       *
-       *  You can get a copy of the pointer that this object owns, for
-       *  situations such as passing to a function which only accepts
-       *  a raw pointer.
-       *
-       *  @note  This %auto_ptr still owns the memory.
-       */
-      element_type*
-      get() const throw() { return _M_ptr; }
-      
-      /**
-       *  @brief  Bypassing the smart pointer.
-       *  @return  The raw pointer being managed.
-       *
-       *  You can get a copy of the pointer that this object owns, for
-       *  situations such as passing to a function which only accepts
-       *  a raw pointer.
-       *
-       *  @note  This %auto_ptr no longer owns the memory.  When this object
-       *  goes out of scope, nothing will happen.
-       */
-      element_type*
-      release() throw()
-      {
-       element_type* __tmp = _M_ptr;
-       _M_ptr = 0;
-       return __tmp;
-      }
-      
-      /**
-       *  @brief  Forcibly deletes the managed object.
-       *  @param  p  A pointer (defaults to NULL).
-       *
-       *  This object now @e owns the object pointed to by @a p.  The
-       *  previous object has been deleted.
-       */
-      void
-      reset(element_type* __p = 0) throw()
-      {
-       if (__p != _M_ptr)
-         {
-           delete _M_ptr;
-           _M_ptr = __p;
-         }
-      }
-      
-      /** 
-       *  @brief  Automatic conversions
-       *
-       *  These operations convert an %auto_ptr into and from an auto_ptr_ref
-       *  automatically as needed.  This allows constructs such as
-       *  @code
-       *    auto_ptr<Derived>  func_returning_auto_ptr(.....);
-       *    ...
-       *    auto_ptr<Base> ptr = func_returning_auto_ptr(.....);
-       *  @endcode
-       */
-      auto_ptr(auto_ptr_ref<element_type> __ref) throw()
-      : _M_ptr(__ref._M_ptr) { }
-      
-      auto_ptr&
-      operator=(auto_ptr_ref<element_type> __ref) throw()
-      {
-       if (__ref._M_ptr != this->get())
-         {
-           delete _M_ptr;
-           _M_ptr = __ref._M_ptr;
-         }
-       return *this;
-      }
-      
-      template<typename _Tp1>
-        operator auto_ptr_ref<_Tp1>() throw()
-        { return auto_ptr_ref<_Tp1>(this->release()); }
-
-      template<typename _Tp1>
-        operator auto_ptr<_Tp1>() throw()
-        { return auto_ptr<_Tp1>(this->release()); }
-    };
-
-  // _GLIBCXX_RESOLVE_LIB_DEFECTS
-  // 541. shared_ptr template assignment and void
-  template<>
-    class auto_ptr<void>
-    {
-    public:
-      typedef void element_type;
-    };
-
-_GLIBCXX_END_NAMESPACE
-
-#endif /* _STL_AUTO_PTR_H */
index ece42a3e2ebc5e749aece13d7821bca378401599..7b392fc104dd01fd1a0322762fcb61cde2703c1b 100644 (file)
@@ -386,108 +386,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     { return binary_negate<_Predicate>(__pred); }
   /** @}  */
 
-  // 20.3.6 binders
-  /** @defgroup s20_3_6_binder Binder Classes
-   *  Binders turn functions/functors with two arguments into functors with
-   *  a single argument, storing an argument to be applied later.  For
-   *  example, a variable @c B of type @c binder1st is constructed from a
-   *  functor @c f and an argument @c x.  Later, B's @c operator() is called
-   *  with a single argument @c y.  The return value is the value of @c f(x,y).
-   *  @c B can be "called" with various arguments (y1, y2, ...) and will in
-   *  turn call @c f(x,y1), @c f(x,y2), ...
-   *
-   *  The function @c bind1st is provided to save some typing.  It takes the
-   *  function and an argument as parameters, and returns an instance of
-   *  @c binder1st.
-   *
-   *  The type @c binder2nd and its creator function @c bind2nd do the same
-   *  thing, but the stored argument is passed as the second parameter instead
-   *  of the first, e.g., @c bind2nd(std::minus<float>,1.3) will create a
-   *  functor whose @c operator() accepts a floating-point number, subtracts
-   *  1.3 from it, and returns the result.  (If @c bind1st had been used,
-   *  the functor would perform "1.3 - x" instead.
-   *
-   *  Creator-wrapper functions like @c bind1st are intended to be used in
-   *  calling algorithms.  Their return values will be temporary objects.
-   *  (The goal is to not require you to type names like
-   *  @c std::binder1st<std::plus<int>> for declaring a variable to hold the
-   *  return value from @c bind1st(std::plus<int>,5).
-   *
-   *  These become more useful when combined with the composition functions.
-   *
-   *  @{
-   */
-  /// One of the @link s20_3_6_binder binder functors@endlink.
-  template<typename _Operation>
-    class binder1st
-    : public unary_function<typename _Operation::second_argument_type,
-                           typename _Operation::result_type>
-    {
-    protected:
-      _Operation op;
-      typename _Operation::first_argument_type value;
-
-    public:
-      binder1st(const _Operation& __x,
-               const typename _Operation::first_argument_type& __y)
-      : op(__x), value(__y) { }
-
-      typename _Operation::result_type
-      operator()(const typename _Operation::second_argument_type& __x) const
-      { return op(value, __x); }
-
-      // _GLIBCXX_RESOLVE_LIB_DEFECTS
-      // 109.  Missing binders for non-const sequence elements
-      typename _Operation::result_type
-      operator()(typename _Operation::second_argument_type& __x) const
-      { return op(value, __x); }
-    };
-
-  /// One of the @link s20_3_6_binder binder functors@endlink.
-  template<typename _Operation, typename _Tp>
-    inline binder1st<_Operation>
-    bind1st(const _Operation& __fn, const _Tp& __x)
-    {
-      typedef typename _Operation::first_argument_type _Arg1_type;
-      return binder1st<_Operation>(__fn, _Arg1_type(__x));
-    }
-
-  /// One of the @link s20_3_6_binder binder functors@endlink.
-  template<typename _Operation>
-    class binder2nd
-    : public unary_function<typename _Operation::first_argument_type,
-                           typename _Operation::result_type>
-    {
-    protected:
-      _Operation op;
-      typename _Operation::second_argument_type value;
-
-    public:
-      binder2nd(const _Operation& __x,
-               const typename _Operation::second_argument_type& __y)
-      : op(__x), value(__y) { }
-
-      typename _Operation::result_type
-      operator()(const typename _Operation::first_argument_type& __x) const
-      { return op(__x, value); }
-
-      // _GLIBCXX_RESOLVE_LIB_DEFECTS
-      // 109.  Missing binders for non-const sequence elements
-      typename _Operation::result_type
-      operator()(typename _Operation::first_argument_type& __x) const
-      { return op(__x, value); }
-    };
-
-  /// One of the @link s20_3_6_binder binder functors@endlink.
-  template<typename _Operation, typename _Tp>
-    inline binder2nd<_Operation>
-    bind2nd(const _Operation& __fn, const _Tp& __x)
-    {
-      typedef typename _Operation::second_argument_type _Arg2_type;
-      return binder2nd<_Operation>(__fn, _Arg2_type(__x));
-    }
-  /** @}  */
-
   // 20.3.7 adaptors pointers functions
   /** @defgroup s20_3_7_adaptors Adaptors for pointers to functions
    *  The advantage of function objects over pointers to functions is that
@@ -802,4 +700,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
 _GLIBCXX_END_NAMESPACE
 
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_USE_DEPRECATED
+# include <backward/binders.h>
+#endif
+
 #endif /* _STL_FUNCTION_H */
index a099b3ed177941cc77b10ab78d09f05003e4d0af..39f72563d17f551b9acd3640a3a5e830eaa56494 100644 (file)
@@ -56,7 +56,6 @@
 #include <bits/stl_construct.h>
 #include <bits/stl_uninitialized.h>
 #include <bits/stl_tempbuf.h>
-#include <bits/stl_auto_ptr.h>
 #include <bits/stl_raw_storage_iter.h>
 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
@@ -73,6 +72,9 @@
 #  include <bits/stl_function.h>  // std::less
 #  include <debug/debug.h>
 #  include <type_traits>
+#  if _GLIBCXX_USE_DEPRECATED
+#    include <backward/auto_ptr.h>
+#  endif
 #  if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
 #    include <tr1_impl/boost_shared_ptr.h>
 #  else
@@ -86,6 +88,8 @@
 #    undef _GLIBCXX_BEGIN_NAMESPACE_TR1
 #    undef _GLIBCXX_INCLUDE_AS_CXX0X
 #  endif
+#else
+#  include <backward/auto_ptr.h>
 #endif
 
 #endif /* _GLIBCXX_MEMORY */
index b6ec8255c6391d379dc004022bdc2c8ea739debf..d5842fa2bc1f0f35e59a60dab1707b545e3c8d40 100644 (file)
@@ -1,7 +1,7 @@
 // Stream buffer classes -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-// Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007 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
@@ -763,7 +763,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       overflow(int_type /* __c */ = traits_type::eof())
       { return traits_type::eof(); }
 
-#ifdef _GLIBCXX_DEPRECATED
+#if _GLIBCXX_USE_DEPRECATED
     // Annex D.6
     public:
       /**
index e3d8827b65d5cc0a5573c20ae60f4fa869c52b69..55c60bc0e17d460289ed6e59d2a243bcb5860d8d 100644 (file)
@@ -277,6 +277,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
            }
        }
 
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_USE_DEPRECATED
       // Special case for auto_ptr<_Tp> to provide the strong guarantee.
       template<typename _Tp>
         explicit
@@ -284,7 +285,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
        : _M_pi(new _Sp_counted_base_impl<_Tp*,
                _Sp_deleter<_Tp>, _Lp >(__r.get(), _Sp_deleter<_Tp>()))
         { __r.release(); }
-  
+#endif
+
       // Throw bad_weak_ptr when __r._M_get_use_count() == 0.
       explicit
       __shared_count(const __weak_count<_Lp>& __r);
@@ -578,6 +580,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
       /**
        * @post use_count() == 1 and __r.get() == 0
        */
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_USE_DEPRECATED
       template<typename _Tp1>
         explicit
         __shared_ptr(std::auto_ptr<_Tp1>& __r)
@@ -589,6 +592,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
          _M_refcount = __shared_count<_Lp>(__r);
          __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
        }
+#endif
 
       template<typename _Tp1>
         __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, __static_cast_tag)
@@ -620,6 +624,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
          return *this;
        }
 
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_USE_DEPRECATED
       template<typename _Tp1>
         __shared_ptr&
         operator=(std::auto_ptr<_Tp1>& __r)
@@ -627,6 +632,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
          __shared_ptr(__r).swap(*this);
          return *this;
        }
+#endif
 
       void
       reset() // never throws
@@ -993,10 +999,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
         shared_ptr(const weak_ptr<_Tp1>& __r)
        : __shared_ptr<_Tp>(__r) { }
 
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_USE_DEPRECATED
       template<typename _Tp1>
         explicit
         shared_ptr(std::auto_ptr<_Tp1>& __r)
        : __shared_ptr<_Tp>(__r) { }
+#endif
 
       template<typename _Tp1>
         shared_ptr(const shared_ptr<_Tp1>& __r, __static_cast_tag)
@@ -1018,6 +1026,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
          return *this;
        }
 
+#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || _GLIBCXX_USE_DEPRECATED
       template<typename _Tp1>
         shared_ptr&
         operator=(std::auto_ptr<_Tp1>& __r)
@@ -1025,6 +1034,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
          this->__shared_ptr<_Tp>::operator=(__r);
          return *this;
        }
+#endif
     };
 
   template<typename _Tp, typename _Tp1>