summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2017-05-15 14:47:40 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2017-05-15 14:47:40 +0100
commit85c05b5eec703f9dd26e05215f336a3518b475df (patch)
treeb9923cca1788e3adff2b0691135820d154b9c635 /libstdc++-v3/testsuite
parent511604823d33a79a88eaa12e881badd2170a0614 (diff)
downloadgcc-85c05b5eec703f9dd26e05215f336a3518b475df.tar.gz
Fix order and types of members in C++17 insert_return_type structs
PR libstdc++/80761 * include/bits/node_handle.h (_Node_insert_return): Reorder members. (tuple_size, tuple_element): Remove partial specializations. * include/bits/stl_tree.h (_Rb_tree::insert_return_type): Use const_iterator for std::set. * testsuite/23_containers/map/modifiers/extract.cc: New. * testsuite/23_containers/set/modifiers/extract.cc: New. * testsuite/23_containers/unordered_map/modifiers/extract.cc: New. * testsuite/23_containers/unordered_set/modifiers/extract.cc: New. From-SVN: r248062
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc11
-rw-r--r--libstdc++-v3/testsuite/23_containers/set/modifiers/extract.cc11
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/extract.cc11
-rw-r--r--libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/extract.cc11
4 files changed, 44 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc b/libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc
index 507a708eed8..80eaf018a70 100644
--- a/libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/modifiers/extract.cc
@@ -135,6 +135,17 @@ test03()
static_assert( is_same_v<test_type::node_type, compat_type3::node_type> );
}
+void
+test04()
+{
+ // Check order of members in insert_return_type
+ auto [pos, ins, node] = test_type::insert_return_type{};
+ using std::is_same_v;
+ static_assert( is_same_v<test_type::iterator, decltype(pos)> );
+ static_assert( is_same_v<bool, decltype(ins)> );
+ static_assert( is_same_v<test_type::node_type, decltype(node)> );
+}
+
int
main()
{
diff --git a/libstdc++-v3/testsuite/23_containers/set/modifiers/extract.cc b/libstdc++-v3/testsuite/23_containers/set/modifiers/extract.cc
index c56767a9a3e..3fbc6b9a798 100644
--- a/libstdc++-v3/testsuite/23_containers/set/modifiers/extract.cc
+++ b/libstdc++-v3/testsuite/23_containers/set/modifiers/extract.cc
@@ -126,6 +126,17 @@ test03()
static_assert( is_same_v<test_type::node_type, compat_type3::node_type> );
}
+void
+test04()
+{
+ // Check order of members in insert_return_type
+ auto [pos, ins, node] = test_type::insert_return_type{};
+ using std::is_same_v;
+ static_assert( is_same_v<test_type::iterator, decltype(pos)> );
+ static_assert( is_same_v<bool, decltype(ins)> );
+ static_assert( is_same_v<test_type::node_type, decltype(node)> );
+}
+
int
main()
{
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/extract.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/extract.cc
index ad87c7096b8..ce50766b496 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/extract.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/extract.cc
@@ -136,6 +136,17 @@ test03()
static_assert( is_same_v<test_type::node_type, compat_type3::node_type> );
}
+void
+test04()
+{
+ // Check order of members in insert_return_type
+ auto [pos, ins, node] = test_type::insert_return_type{};
+ using std::is_same_v;
+ static_assert( is_same_v<test_type::iterator, decltype(pos)> );
+ static_assert( is_same_v<bool, decltype(ins)> );
+ static_assert( is_same_v<test_type::node_type, decltype(node)> );
+}
+
int
main()
{
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/extract.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/extract.cc
index 6f77a94d321..5be81951407 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/extract.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/extract.cc
@@ -128,6 +128,17 @@ test03()
static_assert( is_same_v<test_type::node_type, compat_type3::node_type> );
}
+void
+test04()
+{
+ // Check order of members in insert_return_type
+ auto [pos, ins, node] = test_type::insert_return_type{};
+ using std::is_same_v;
+ static_assert( is_same_v<test_type::iterator, decltype(pos)> );
+ static_assert( is_same_v<bool, decltype(ins)> );
+ static_assert( is_same_v<test_type::node_type, decltype(node)> );
+}
+
int
main()
{