* [PATCH] Fix tests that fail in C++98 mode
@ 2018-08-22 23:43 Jonathan Wakely
2018-08-23 15:10 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2018-08-22 23:43 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 461 bytes --]
* testsuite/23_containers/deque/capacity/max_size.cc: Fix test for
C++98 mode.
* testsuite/23_containers/deque/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/list/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/vector/bool/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/vector/capacity/max_size.cc: Likewise.
* testsuite/23_containers/vector/modifiers/assign/1.cc: Likewise.
Tested x86_64-linux, committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 3943 bytes --]
commit 4eefeb30f431f9c9b138374ce56a6f4a59689164
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Aug 23 00:40:58 2018 +0100
Fix tests that fail in C++98 mode
* testsuite/23_containers/deque/capacity/max_size.cc: Fix test for
C++98 mode.
* testsuite/23_containers/deque/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/list/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/vector/bool/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/vector/capacity/max_size.cc: Likewise.
* testsuite/23_containers/vector/modifiers/assign/1.cc: Likewise.
diff --git a/libstdc++-v3/testsuite/23_containers/deque/capacity/max_size.cc b/libstdc++-v3/testsuite/23_containers/deque/capacity/max_size.cc
index 3dabdd05544..1a38c4ed698 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/capacity/max_size.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/capacity/max_size.cc
@@ -22,7 +22,7 @@
#include <limits>
#include <testsuite_hooks.h>
-using test_type = std::deque<char>;
+typedef std::deque<char> test_type;
typedef test_type::size_type size_type;
typedef test_type::difference_type difference_type;
diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/assign/1.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/assign/1.cc
index fbab09b9ba2..a6668f7c199 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/modifiers/assign/1.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/modifiers/assign/1.cc
@@ -27,7 +27,7 @@ int main()
{
std::deque<int> d;
- int array[] { 0, 1, 2 };
+ int array[] = { 0, 1, 2 };
input_iterator_seq seq(array, array + 3);
d.assign(seq.begin(), seq.end());
diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/assign/1.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/assign/1.cc
index c5fde47059a..f4d32883328 100644
--- a/libstdc++-v3/testsuite/23_containers/list/modifiers/assign/1.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/modifiers/assign/1.cc
@@ -27,7 +27,7 @@ int main()
{
std::list<int> l;
- int array[] { 0, 1, 2 };
+ int array[] = { 0, 1, 2 };
input_iterator_seq seq(array, array + 3);
l.assign(seq.begin(), seq.end());
diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/assign/1.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/assign/1.cc
index 833201b39a3..06fb2ab2d03 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/assign/1.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/assign/1.cc
@@ -27,7 +27,7 @@ void test01()
std::vector<bool> bv;
- bool array[] { false, true, true };
+ bool array[] = { false, true, true };
input_iterator_seq seq(array, array + 3);
bv.assign(seq.begin(), seq.end());
diff --git a/libstdc++-v3/testsuite/23_containers/vector/capacity/max_size.cc b/libstdc++-v3/testsuite/23_containers/vector/capacity/max_size.cc
index 499cd7660f9..34d3c4ab96e 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/capacity/max_size.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/capacity/max_size.cc
@@ -22,7 +22,7 @@
#include <limits>
#include <testsuite_hooks.h>
-using test_type = std::vector<char>;
+typedef std::vector<char> test_type;
typedef test_type::size_type size_type;
typedef test_type::difference_type difference_type;
diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/assign/1.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/assign/1.cc
index ca7b125e7ca..001f204c93b 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/modifiers/assign/1.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/modifiers/assign/1.cc
@@ -27,7 +27,7 @@ void test01()
std::vector<int> v;
- int array[] { 0, 1, 2 };
+ int array[] = { 0, 1, 2 };
input_iterator_seq seq(array, array + 3);
v.assign(seq.begin(), seq.end());
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix tests that fail in C++98 mode
2018-08-22 23:43 [PATCH] Fix tests that fail in C++98 mode Jonathan Wakely
@ 2018-08-23 15:10 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2018-08-23 15:10 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 554 bytes --]
On 23/08/18 00:42 +0100, Jonathan Wakely wrote:
> * testsuite/23_containers/deque/capacity/max_size.cc: Fix test for
> C++98 mode.
> * testsuite/23_containers/deque/modifiers/assign/1.cc: Likewise.
> * testsuite/23_containers/list/modifiers/assign/1.cc: Likewise.
> * testsuite/23_containers/vector/bool/modifiers/assign/1.cc: Likewise.
> * testsuite/23_containers/vector/capacity/max_size.cc: Likewise.
> * testsuite/23_containers/vector/modifiers/assign/1.cc: Likewise.
Two more fixes along the same lines.
Tested x86_64-linux, committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1512 bytes --]
commit 132a337e0f59fa4a6fd2213418c6bb2e922ecf44
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Aug 23 14:17:36 2018 +0100
Fix C++98 tests to not use C++11 features.
* testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc:
Fix C++98 test to not use C++11 features.
* testsuite/25_algorithms/fill_n/2.cc: Likewise.
diff --git a/libstdc++-v3/testsuite/25_algorithms/fill_n/2.cc b/libstdc++-v3/testsuite/25_algorithms/fill_n/2.cc
index 6e18032e1e6..fb951b5c175 100644
--- a/libstdc++-v3/testsuite/25_algorithms/fill_n/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/fill_n/2.cc
@@ -31,7 +31,7 @@ test01()
ref.push_back(1);
ref.push_back(2);
- std::vector<std::vector<int>> vvect;
+ std::vector<std::vector<int> > vvect;
vvect.push_back(std::vector<int>());
vvect.push_back(std::vector<int>());
diff --git a/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc b/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc
index 84449d6dbd4..5da782a4550 100644
--- a/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc
@@ -31,8 +31,8 @@ bad_lower(int lhs, int rhs)
void test01()
{
- int ins[] { 0, 1, 2, 3 };
- int outs[] { 9, 9 };
+ int ins[] = { 0, 1, 2, 3 };
+ int outs[] = { 9, 9 };
std::partial_sort_copy(ins, ins + 4, outs, outs + 2, bad_lower);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-23 15:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22 23:43 [PATCH] Fix tests that fail in C++98 mode Jonathan Wakely
2018-08-23 15:10 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).