From: Jonathan Wakely
Date: Tue, 12 Jul 2016 14:00:26 +0000 (+0100)
Subject: Add tests and docs for LWG 2212 support
X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b24fb4cd134921ada7152cfcddc6a84e01d1fd6;p=gcc.git
Add tests and docs for LWG 2212 support
* testsuite/20_util/pair/astuple/astuple.cc: Only include .
* testsuite/23_containers/array/tuple_interface/tuple_element.cc:
Only include .
* 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
---
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index d0f14045647..2d9223d7c5e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,13 @@
2016-07-12 Jonathan Wakely
+ * testsuite/20_util/pair/astuple/astuple.cc: Only include .
+ * testsuite/23_containers/array/tuple_interface/tuple_element.cc:
+ Only include .
+ * 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 65ffc01a45b..664d3925a36 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -408,6 +408,11 @@
2196:
Specification of is_*[copy/move]_[constructible/assignable] unclear for non-referencable types
Use the referenceable type concept.
+
2212:
+ tuple_size for const pair request <tuple> header
+
The tuple_size and tuple_element
+ partial specializations are defined in <utility> which
+ is included by <array>.
2313:
tuple_size should always derive from integral_constant<size_t, N>
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 2aa9ba7a896..a47a3ecc4ba 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.
Use the referenceable type concept.
+ 2212:
+ tuple_size for const pair request <tuple> header
+
+ The tuple_size and tuple_element
+ partial specializations are defined in <utility> which
+ is included by <array>.
+
+
2313:
tuple_size should always derive from integral_constant<size_t, N>
diff --git a/libstdc++-v3/testsuite/20_util/pair/astuple/astuple.cc b/libstdc++-v3/testsuite/20_util/pair/astuple/astuple.cc
index 8b6fca3a6e0..3a458bb30e5 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
// .
+// NB: Don't include any other headers in this file.
+// LWG 2212 requires to define tuple_size and
+// tuple_element specializations.
#include
-#include
typedef std::pair test_type;
@@ -32,6 +34,7 @@ static_assert( std::tuple_size::value == 2,
template
using Tuple_elt = typename std::tuple_element::type;
+// This relies on the fact that includes :
using std::is_same;
static_assert( is_same, 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 96e0bfbe72b..65da7537df9 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
// .
+// NB: Don't include any other headers in this file.
+// LWG 2212 requires to define tuple_element specializations.
#include
-#include
-#include
void
test01()
{
bool test __attribute__((unused)) = true;
- using namespace std;
+ using std::array;
+ using std::tuple_element;
+ // This relies on the fact that includes :
+ using std::is_same;
const size_t len = 3;
typedef array 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 4a95fa7b7df..6fe501e8e04 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
// .
+// NB: Don't include any other headers in this file.
+// LWG 2212 requires to define tuple_size specializations.
#include
-#include
void
test01()
{
bool test __attribute__((unused)) = true;
- using namespace std;
+ using std::array;
+ using std::tuple_size;
+ // This relies on the fact that includes :
+ using std::is_same;
{
const size_t len = 5;