move.h (swap(_Tp(&)[_Nm], _Tp(&)[_Nm])): Remove workaround for c++/49045.
authorPaolo Carlini <paolo.carlini@oracle.com>
Sun, 28 Aug 2011 21:05:48 +0000 (21:05 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sun, 28 Aug 2011 21:05:48 +0000 (21:05 +0000)
2011-08-28  Paolo Carlini  <paolo.carlini@oracle.com>

* include/bits/move.h (swap(_Tp(&)[_Nm], _Tp(&)[_Nm])): Remove
workaround for c++/49045.
* include/bits/algorithmfwd.h: Likewise.

From-SVN: r178147

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/algorithmfwd.h
libstdc++-v3/include/bits/move.h

index d0bd7d993d3fcd480d5c779d841f1d92123f684c..69e297de9433b411b8cc2d304e7530ff61444cc5 100644 (file)
@@ -1,3 +1,9 @@
+2011-08-28  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/bits/move.h (swap(_Tp(&)[_Nm], _Tp(&)[_Nm])): Remove
+       workaround for c++/49045.
+       * include/bits/algorithmfwd.h: Likewise.
+
 2011-08-25  Tom Tromey  <tromey@redhat.com>
 
        * testsuite/libstdc++-prettyprinters/simple.cc: New file.
index 7bb9880ebebcf1d85a5613b84908817385de39b4..cc0b98ed7d280b63629ab230eebed11a714f3849 100644 (file)
@@ -558,9 +558,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Tp, size_t _Nm>
     void
-    swap(_Tp (&)[_Nm], _Tp (&)[_Nm])
+    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
-    noexcept(__is_nothrow_swappable<_Tp>::value)
+    noexcept(noexcept(swap(*__a, *__b)))
 #endif
     ;
 
index 0af8fdac0b59316f652b4d28a952c7e681ddf554..f5beb22bb8d922374dddf26ac4fc68e846c533f9 100644 (file)
@@ -152,21 +152,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       __b = _GLIBCXX_MOVE(__tmp);
     }
 
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
-  // To work around c++/49045.
-  template<typename _Tp>
-    struct __is_nothrow_swappable
-    { static const bool value = noexcept(swap(std::declval<_Tp&>(),
-                                             std::declval<_Tp&>())); };
-#endif
-
   // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // DR 809. std::swap should be overloaded for array types.
   template<typename _Tp, size_t _Nm>
     inline void
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
-    noexcept(__is_nothrow_swappable<_Tp>::value)
+    noexcept(noexcept(swap(*__a, *__b)))
 #endif
     {
       for (size_t __n = 0; __n < _Nm; ++__n)