]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/55363 (tuple_size is not a class template)
authorPaolo Carlini <paolo.carlini@oracle.com>
Sat, 17 Nov 2012 12:09:58 +0000 (12:09 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sat, 17 Nov 2012 12:09:58 +0000 (12:09 +0000)
2012-11-17  Paolo Carlini  <paolo.carlini@oracle.com>

PR libstdc++/55363
* include/std/array (tuple_size, tuple_element): Move out
NAMESPACE_CONTAINER.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust
dg-error line numbers.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
Likewise.

From-SVN: r193584

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/array
libstdc++-v3/testsuite/23_containers/array/tuple_interface/get_neg.cc
libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc

index 9be305b97e8930dc842883f106f858a4f71304f7..a2933c52fe4858671ed61387b74ac234b0b6113a 100644 (file)
@@ -1,3 +1,13 @@
+2012-11-17  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR libstdc++/55363
+       * include/std/array (tuple_size, tuple_element): Move out
+       NAMESPACE_CONTAINER.
+       * testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust
+       dg-error line numbers.
+       * testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
+       Likewise.
+
 2012-11-16  François Dumont  <fdumont@gcc.gnu.org>
 
        * include/bits/hashtable_policy.h (_Prime_rehash_policy): Remove
index 00d3123225c7818247b47f3d0ea85699a013b8c7..a4ecf5a547ca90e6370311de01d19bf2b928b006 100644 (file)
@@ -263,27 +263,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     noexcept(noexcept(__one.swap(__two)))
     { __one.swap(__two); }
 
-  // Tuple interface to class template array.
-
-  /// tuple_size
-  template<typename _Tp> 
-    class tuple_size;
-
-  template<typename _Tp, std::size_t _Nm>
-    struct tuple_size<array<_Tp, _Nm>>
-    : public integral_constant<std::size_t, _Nm> { };
-
-  /// tuple_element
-  template<std::size_t _Int, typename _Tp>
-    class tuple_element;
-
-  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
-    struct tuple_element<_Int, array<_Tp, _Nm>>
-    {
-      static_assert(_Int < _Nm, "index is out of bounds");
-      typedef _Tp type;
-    };
-
   template<std::size_t _Int, typename _Tp, std::size_t _Nm>
     constexpr _Tp&
     get(array<_Tp, _Nm>& __arr) noexcept
@@ -313,6 +292,34 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
 _GLIBCXX_END_NAMESPACE_CONTAINER
 } // namespace std
 
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // Tuple interface to class template array.
+
+  /// tuple_size
+  template<typename _Tp> 
+    class tuple_size;
+
+  template<typename _Tp, std::size_t _Nm>
+    struct tuple_size<_GLIBCXX_STD_C::array<_Tp, _Nm>>
+    : public integral_constant<std::size_t, _Nm> { };
+
+  /// tuple_element
+  template<std::size_t _Int, typename _Tp>
+    class tuple_element;
+
+  template<std::size_t _Int, typename _Tp, std::size_t _Nm>
+    struct tuple_element<_Int, _GLIBCXX_STD_C::array<_Tp, _Nm>>
+    {
+      static_assert(_Int < _Nm, "index is out of bounds");
+      typedef _Tp type;
+    };
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
 #ifdef _GLIBCXX_DEBUG
 # include <debug/array>
 #endif
index 5df2f0f3816b99f8f646109f2cec5d6be5202e98..5c39534d91290b50bb1b8c5839a32a39481b9fdb 100644 (file)
@@ -28,6 +28,6 @@ int n1 = std::get<1>(a);
 int n2 = std::get<1>(std::move(a));
 int n3 = std::get<1>(ca);
 
-// { dg-error "static assertion failed" "" { target *-*-* } 291 }
-// { dg-error "static assertion failed" "" { target *-*-* } 300 }
-// { dg-error "static assertion failed" "" { target *-*-* } 308 }
+// { dg-error "static assertion failed" "" { target *-*-* } 270 }
+// { dg-error "static assertion failed" "" { target *-*-* } 279 }
+// { dg-error "static assertion failed" "" { target *-*-* } 287 }
index 33c6090b0c8d1c0150df85d6c2f0c9eb289c9aa3..91fc328c6d8f21a6e0f5e2b19ac0b9b6f632beb2 100644 (file)
@@ -23,4 +23,4 @@
 
 typedef std::tuple_element<1, std::array<int, 1>>::type type;
 
-// { dg-error "static assertion failed" "" { target *-*-* } 283 }
+// { dg-error "static assertion failed" "" { target *-*-* } 316 }