aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2016-07-12 15:00:26 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2016-07-12 15:00:26 +0100
commit1b24fb4cd134921ada7152cfcddc6a84e01d1fd6 (patch)
tree70d1ee1f203f1f0a333da0c6a734dd02056c2bf3 /libstdc++-v3
parent17b31c054cdda9ac6167c548a41c5fb4eca0ebb3 (diff)
downloadgcc-1b24fb4cd134921ada7152cfcddc6a84e01d1fd6.zip
gcc-1b24fb4cd134921ada7152cfcddc6a84e01d1fd6.tar.gz
gcc-1b24fb4cd134921ada7152cfcddc6a84e01d1fd6.tar.bz2
Add tests and docs for LWG 2212 support
* 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
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/doc/html/manual/bugs.html5
-rw-r--r--libstdc++-v3/doc/xml/manual/intro.xml8
-rw-r--r--libstdc++-v3/testsuite/20_util/pair/astuple/astuple.cc5
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc9
-rw-r--r--libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc8
6 files changed, 37 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d0f1404..2d9223d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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.
diff --git a/libstdc++-v3/doc/html/manual/bugs.html b/libstdc++-v3/doc/html/manual/bugs.html
index 65ffc01..664d392 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -408,6 +408,11 @@
</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.
diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml
index 2aa9ba7..a47a3ec 100644
--- a/libstdc++-v3/doc/xml/manual/intro.xml
+++ b/libstdc++-v3/doc/xml/manual/intro.xml
@@ -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>
diff --git a/libstdc++-v3/testsuite/20_util/pair/astuple/astuple.cc b/libstdc++-v3/testsuite/20_util/pair/astuple/astuple.cc
index 8b6fca3..3a458bb 100644
--- a/libstdc++-v3/testsuite/20_util/pair/astuple/astuple.cc
+++ b/libstdc++-v3/testsuite/20_util/pair/astuple/astuple.cc
@@ -18,8 +18,10 @@
// 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,
diff --git a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc
index 96e0bfb..65da753 100644
--- a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_element.cc
@@ -18,15 +18,18 @@
// 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;
diff --git a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc
index 4a95fa7..6fe501e 100644
--- a/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc
+++ b/libstdc++-v3/testsuite/23_containers/array/tuple_interface/tuple_size.cc
@@ -18,14 +18,18 @@
// 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;