Add tests and docs for LWG 2212 support
authorJonathan Wakely <jwakely@redhat.com>
Tue, 12 Jul 2016 14:00:26 +0000 (15:00 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 12 Jul 2016 14:00:26 +0000 (15:00 +0100)
* testsuite/20_util/pair/astuple/astuple.cc: Only include <utility>.
* testsuite/23_containers/array/tuple_interface/tuple_element.cc:
Only include <array>.
* testsuite/23_containers/array/tuple_interface/tuple_size.cc:
Likewise.
* doc/xml/manual/intro.xml; Document LWG 2212 support.
* doc/html*: Regenerate.

From-SVN: r238244

libstdc++-v3/ChangeLog
libstdc++-v3/doc/html/manual/bugs.html
libstdc++-v3/doc/xml/manual/intro.xml
libstdc++-v3/testsuite/20_util/pair/astuple/astuple.cc
libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc
libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc

index d0f14045647e96c35a16f6ea6c2caf0f5b953a85..2d9223d7c5ec9b7e6fc06e5e97d5c549585fa8e2 100644 (file)
@@ -1,5 +1,13 @@
 2016-07-12  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/20_util/pair/astuple/astuple.cc: Only include <utility>.
+       * testsuite/23_containers/array/tuple_interface/tuple_element.cc:
+       Only include <array>.
+       * testsuite/23_containers/array/tuple_interface/tuple_size.cc:
+       Likewise.
+       * doc/xml/manual/intro.xml; Document LWG 2212 support.
+       * doc/html*: Regenerate.
+
        * testsuite/23_containers/vector/modifiers/emplace/self_emplace.cc:
        Add testcase from LWG 2164.
 
index 65ffc01a45be557ec3575ea5dff506afbe81d4cf..664d3925a36c4b55d8de4bfe9ccf6a1214e5c20c 100644 (file)
     </p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2196" target="_top">2196</a>:
        <span class="emphasis"><em>Specification of <code class="code">is_*[copy/move]_[constructible/assignable]</code> unclear for non-referencable types</em></span>
     </span></dt><dd><p>Use the referenceable type concept.
+    </p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2212" target="_top">2212</a>:
+       <span class="emphasis"><em><code class="code">tuple_size</code> for <code class="code">const pair</code> request <code class="code">&lt;tuple&gt;</code> header</em></span>
+    </span></dt><dd><p>The <code class="code">tuple_size</code> and <code class="code">tuple_element</code>
+    partial specializations are defined in <code class="code">&lt;utility&gt;</code> which
+    is included by <code class="code">&lt;array&gt;</code>.
     </p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#2313" target="_top">2313</a>:
        <span class="emphasis"><em><code class="code">tuple_size</code> should always derive from <code class="code">integral_constant&lt;size_t, N&gt;</code></em></span>
     </span></dt><dd><p>Update definitions of the partial specializations for const and volatile types.
index 2aa9ba7a896d78f5734841e5915b5922f40b9366..a47a3ecc4bafd5365d647f6ea393754068f3bce0 100644 (file)
@@ -934,6 +934,14 @@ requirements of the license of GCC.
     <listitem><para>Use the referenceable type concept.
     </para></listitem></varlistentry>
 
+    <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#2212">2212</link>:
+       <emphasis><code>tuple_size</code> for <code>const pair</code> request <code>&lt;tuple&gt;</code> header</emphasis>
+    </term>
+    <listitem><para>The <code>tuple_size</code> and <code>tuple_element</code>
+    partial specializations are defined in <code>&lt;utility&gt;</code> which
+    is included by <code>&lt;array&gt;</code>.
+    </para></listitem></varlistentry>
+
     <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../ext/lwg-defects.html#2313">2313</link>:
        <emphasis><code>tuple_size</code> should always derive from <code>integral_constant&lt;size_t, N&gt;</code></emphasis>
     </term>
index 8b6fca3a6e0384380b0cf98fd36d6cdeaa357d2d..3a458bb30e5a6a4e4c45129b7e1c845eaa7551d5 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// NB: Don't include any other headers in this file.
+// LWG 2212 requires <utility> to define tuple_size<cv T> and
+// tuple_element<cv T> specializations.
 #include <utility>
-#include <type_traits>
 
 typedef std::pair<int, long> test_type;
 
@@ -32,6 +34,7 @@ static_assert( std::tuple_size<const volatile test_type>::value == 2,
 template<std::size_t N, typename T>
   using Tuple_elt = typename std::tuple_element<N, T>::type;
 
+// This relies on the fact that <utility> includes <type_traits>:
 using std::is_same;
 
 static_assert( is_same<Tuple_elt<0, test_type>, test_type::first_type>::value,
index 96e0bfbe72b5942d6e6792875714dbd7003651f9..65da7537df972868a336993f2ab3a7b5810bca2c 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// NB: Don't include any other headers in this file.
+// LWG 2212 requires <array> to define tuple_element<cv T> specializations.
 #include <array>
-#include <type_traits>
-#include <testsuite_hooks.h>
 
 void
 test01() 
 { 
   bool test __attribute__((unused)) = true;
-  using namespace std;
+  using std::array;
+  using std::tuple_element;
+  // This relies on the fact that <utility> includes <type_traits>:
+  using std::is_same;
 
   const size_t len = 3;
   typedef array<int, len> array_type;
index 4a95fa7b7dfeffec3bfdf85d0d0a8c705df57e2c..6fe501e8e041c0acbe436403d181ea8331c709d5 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// NB: Don't include any other headers in this file.
+// LWG 2212 requires <array> to define tuple_size<cv T> specializations.
 #include <array>
-#include <testsuite_hooks.h>
 
 void
 test01() 
 { 
   bool test __attribute__((unused)) = true;
-  using namespace std;
+  using std::array;
+  using std::tuple_size;
+  // This relies on the fact that <utility> includes <type_traits>:
+  using std::is_same;
 
   {
     const size_t len = 5;