[libcxx-commits] [libcxx] 10d3869 - [libc++] NFC: Tidy up the reverse_iterator tests
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jun 3 12:00:20 PDT 2021
Author: Louis Dionne
Date: 2021-06-03T15:00:13-04:00
New Revision: 10d38699524a6092dc85f150fc1078567dde9537
URL: https://github.com/llvm/llvm-project/commit/10d38699524a6092dc85f150fc1078567dde9537
DIFF: https://github.com/llvm/llvm-project/commit/10d38699524a6092dc85f150fc1078567dde9537.diff
LOG: [libc++] NFC: Tidy up the reverse_iterator tests
Incidentally, that fixes an error with the modules build.
Added:
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/assign.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.default.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.reverse_iterator.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/minus.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/types.pass.cpp
Modified:
libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
Removed:
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.compile.fail.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.compile.fail.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.conv/tested_elsewhere.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/difference_type.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/difference_type.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/difference_type.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/difference_type.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.compile.fail.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opdiff/test.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/difference_type.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/difference_type.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.requirements/nothing_to_do.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iterator/types.pass.cpp
################################################################################
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
index 10231b4080e5a..2ad643ae44e39 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
@@ -17,7 +17,7 @@
#include "test_iterators.h"
template<class I1>
-[[nodiscard]] consteval bool common_reverse_iterator_checks() {
+constexpr bool common_reverse_iterator_checks() {
static_assert(std::indirectly_writable<I1, int>);
static_assert(std::sentinel_for<I1, I1>);
static_assert(std::sentinel_for<I1, std::reverse_iterator<float*>>);
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp
similarity index 68%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp
index 7bd699bb9ead9..fcf8d88fcf62b 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op==/test.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp
@@ -12,10 +12,7 @@
// template <BidirectionalIterator Iter1, BidirectionalIterator Iter2>
// requires HasEqualTo<Iter1, Iter2>
-// constexpr bool
-// operator==(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
-//
-// constexpr in C++17
+// bool operator==(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y); // constexpr since C++17
#include <iterator>
#include <cassert>
@@ -24,16 +21,13 @@
#include "test_iterators.h"
template <class It>
-void
-test(It l, It r, bool x)
-{
+TEST_CONSTEXPR_CXX17 void test(It l, It r, bool x) {
const std::reverse_iterator<It> r1(l);
const std::reverse_iterator<It> r2(r);
assert((r1 == r2) == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s), true);
test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+1), false);
@@ -41,19 +35,13 @@ int main(int, char**)
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), false);
test(s, s, true);
test(s, s+1, false);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p);
- constexpr RI it3 = std::make_reverse_iterator(p+1);
- static_assert( (it1 == it2), "");
- static_assert(!(it1 == it3), "");
- }
+ static_assert(tests(), "");
#endif
-
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp
similarity index 67%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp
index de53281202f80..fdcd02abb0d8e 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt=/test.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp
@@ -12,10 +12,7 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasGreater<Iter1, Iter2>
-// constexpr bool
-// operator>=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
-//
-// constexpr in C++17
+// bool operator>=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y); // constexpr since C++17
#include <iterator>
#include <cassert>
@@ -24,16 +21,13 @@
#include "test_iterators.h"
template <class It>
-void
-test(It l, It r, bool x)
-{
+TEST_CONSTEXPR_CXX17 void test(It l, It r, bool x) {
const std::reverse_iterator<It> r1(l);
const std::reverse_iterator<It> r2(r);
assert((r1 >= r2) == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s), true);
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), true);
@@ -41,18 +35,13 @@ int main(int, char**)
test(s, s, true);
test(s, s+1, true);
test(s+1, s, false);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p);
- constexpr RI it3 = std::make_reverse_iterator(p+1);
- static_assert( (it1 >= it2), "");
- static_assert( (it1 >= it3), "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp
similarity index 67%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp
index 86b19e3fc6a32..dce331e519646 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opgt/test.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp
@@ -12,10 +12,7 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasGreater<Iter1, Iter2>
-// constexpr bool
-// operator>(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
-//
-// constexpr in C++17
+// bool operator>(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -24,16 +21,13 @@
#include "test_iterators.h"
template <class It>
-void
-test(It l, It r, bool x)
-{
+TEST_CONSTEXPR_CXX17 void test(It l, It r, bool x) {
const std::reverse_iterator<It> r1(l);
const std::reverse_iterator<It> r2(r);
assert((r1 > r2) == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s), false);
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), true);
@@ -41,18 +35,13 @@ int main(int, char**)
test(s, s, false);
test(s, s+1, true);
test(s+1, s, false);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p);
- constexpr RI it3 = std::make_reverse_iterator(p+1);
- static_assert(!(it1 > it2), "");
- static_assert( (it1 > it3), "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp
similarity index 67%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp
index 92752361152f6..e9cea6250a764 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt=/test.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp
@@ -12,10 +12,7 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasGreater<Iter1, Iter2>
-// constexpr bool
-// operator<=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
-//
-// constexpr in C++17
+// bool operator<=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -24,16 +21,13 @@
#include "test_iterators.h"
template <class It>
-void
-test(It l, It r, bool x)
-{
+TEST_CONSTEXPR_CXX17 void test(It l, It r, bool x) {
const std::reverse_iterator<It> r1(l);
const std::reverse_iterator<It> r2(r);
assert((r1 <= r2) == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s), true);
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), false);
@@ -41,18 +35,13 @@ int main(int, char**)
test(s, s, true);
test(s, s+1, false);
test(s+1, s, true);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p);
- constexpr RI it3 = std::make_reverse_iterator(p+1);
- static_assert( (it1 <= it2), "");
- static_assert(!(it1 <= it3), "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp
similarity index 67%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp
index e49821f833caf..b66147cf3a03c 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.oplt/test.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp
@@ -12,10 +12,7 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasGreater<Iter1, Iter2>
-// constexpr bool
-// operator<(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
-//
-// constexpr in C++17
+// bool operator<(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -24,16 +21,13 @@
#include "test_iterators.h"
template <class It>
-void
-test(It l, It r, bool x)
-{
+TEST_CONSTEXPR_CXX17 void test(It l, It r, bool x) {
const std::reverse_iterator<It> r1(l);
const std::reverse_iterator<It> r2(r);
assert((r1 < r2) == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s), false);
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), false);
@@ -41,18 +35,13 @@ int main(int, char**)
test(s, s, false);
test(s, s+1, false);
test(s+1, s, true);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p);
- constexpr RI it3 = std::make_reverse_iterator(p+1);
- static_assert(!(it1 < it2), "");
- static_assert(!(it1 < it3), "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp
similarity index 68%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp
index f3e7497096795..37a6ff1302ce7 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op!=/test.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp
@@ -12,10 +12,7 @@
// template <BidirectionalIterator Iter1, BidirectionalIterator Iter2>
// requires HasEqualTo<Iter1, Iter2>
-// constexpr bool
-// operator!=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);
-//
-// constexpr in C++17
+// bool operator!=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -24,16 +21,13 @@
#include "test_iterators.h"
template <class It>
-void
-test(It l, It r, bool x)
-{
+TEST_CONSTEXPR_CXX17 void test(It l, It r, bool x) {
const std::reverse_iterator<It> r1(l);
const std::reverse_iterator<It> r2(r);
assert((r1 != r2) == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s), false);
test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+1), true);
@@ -41,18 +35,13 @@ int main(int, char**)
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), true);
test(s, s, false);
test(s, s+1, true);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p);
- constexpr RI it3 = std::make_reverse_iterator(p+1);
- static_assert(!(it1 != it2), "");
- static_assert( (it1 != it3), "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/assign.pass.cpp
similarity index 60%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/assign.pass.cpp
index 838bdc917e2a3..95c6bde040ab1 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/assign.pass.cpp
@@ -11,11 +11,7 @@
// reverse_iterator
// template <class U>
-// requires HasAssign<Iter, const U&>
-// constexpr reverse_iterator&
-// operator=(const reverse_iterator<U>& u);
-//
-// constexpr in C++17
+// reverse_iterator& operator=(const reverse_iterator<U>& u); // constexpr since C++17
#include <iterator>
#include <cassert>
@@ -24,9 +20,7 @@
#include "test_iterators.h"
template <class It, class U>
-void
-test(U u)
-{
+TEST_CONSTEXPR_CXX17 void test(U u) {
const std::reverse_iterator<U> r2(u);
std::reverse_iterator<It> r1;
std::reverse_iterator<It>& rr = r1 = r2;
@@ -34,27 +28,21 @@ test(U u)
assert(&rr == &r1);
}
-struct Base {};
-struct Derived : Base {};
+struct Base { };
+struct Derived : Base { };
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
Derived d;
-
test<bidirectional_iterator<Base*> >(bidirectional_iterator<Derived*>(&d));
test<random_access_iterator<const Base*> >(random_access_iterator<Derived*>(&d));
test<Base*>(&d);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- using BaseIter = std::reverse_iterator<const Base *>;
- using DerivedIter = std::reverse_iterator<const Derived *>;
- constexpr const Derived *p = nullptr;
- constexpr DerivedIter it1 = std::make_reverse_iterator(p);
- constexpr BaseIter it2 = (BaseIter{nullptr} = it1);
- static_assert(it2.base() == p, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.default.pass.cpp
similarity index 76%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.default.pass.cpp
index 32931eefa9169..fcb96de91d1a0 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/default.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.default.pass.cpp
@@ -10,9 +10,7 @@
// reverse_iterator
-// constexpr reverse_iterator();
-//
-// constexpr in C++17
+// reverse_iterator(); // constexpr since C++17
#include <iterator>
@@ -20,26 +18,23 @@
#include "test_iterators.h"
template <class It>
-void
-test()
-{
+TEST_CONSTEXPR_CXX17 void test() {
std::reverse_iterator<It> r;
(void)r;
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
test<bidirectional_iterator<const char*> >();
test<random_access_iterator<char*> >();
test<char*>();
test<const char*>();
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr std::reverse_iterator<const char *> it;
- (void)it;
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.compile.fail.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
similarity index 62%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.compile.fail.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
index 79e484a66af49..940848b300eef 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.compile.fail.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.explicit.verify.cpp
@@ -6,30 +6,18 @@
//
//===----------------------------------------------------------------------===//
-// GCC 5 does not evaluate static assertions dependent on a template parameter.
-// UNSUPPORTED: gcc-5
-
// <iterator>
// reverse_iterator
// explicit reverse_iterator(Iter x);
-// test explicit
+// test explicitness
#include <iterator>
-template <class It>
-void
-test(It i)
-{
- std::reverse_iterator<It> r = i;
-}
-
-int main(int, char**)
-{
- const char s[] = "123";
- test(s);
-
- return 0;
+int main(int, char**) {
+ char const* it = "";
+ std::reverse_iterator<char const*> r = it; // expected-error{{no viable conversion from 'const char *' to 'std::reverse_iterator<const char *>'}}
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.pass.cpp
similarity index 72%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.pass.cpp
index 32cc74f9586a1..801b2cf879ce5 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/iter.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.pass.cpp
@@ -10,9 +10,7 @@
// reverse_iterator
-// explicit constexpr reverse_iterator(Iter x);
-//
-// constexpr in C++17
+// explicit reverse_iterator(Iter x); // constexpr since C++17
#include <iterator>
#include <cassert>
@@ -21,27 +19,23 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i)
-{
+TEST_CONSTEXPR_CXX17 void test(It i) {
std::reverse_iterator<It> r(i);
assert(r.base() == i);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char s[] = "123";
test(bidirectional_iterator<const char*>(s));
test(random_access_iterator<const char*>(s));
test(s);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- constexpr std::reverse_iterator<const char *> it(p);
- static_assert(it.base() == p);
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.reverse_iterator.pass.cpp
similarity index 64%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.reverse_iterator.pass.cpp
index 53b82bd4038c8..9aa6995e0ebba 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.reverse_iterator.pass.cpp
@@ -11,10 +11,7 @@
// reverse_iterator
// template <class U>
-// requires HasConstructor<Iter, const U&>
-// constexpr reverse_iterator(const reverse_iterator<U> &u);
-//
-// constexpr in C++17
+// reverse_iterator(const reverse_iterator<U> &u); // constexpr since C++17
#include <iterator>
#include <cassert>
@@ -22,34 +19,28 @@
#include "test_macros.h"
#include "test_iterators.h"
+struct Base { };
+struct Derived : Base { };
+
template <class It, class U>
-void
-test(U u)
-{
+TEST_CONSTEXPR_CXX17 void test(U u) {
const std::reverse_iterator<U> r2(u);
std::reverse_iterator<It> r1 = r2;
assert(r1.base() == u);
}
-struct Base {};
-struct Derived : Base {};
-
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
Derived d;
-
test<bidirectional_iterator<Base*> >(bidirectional_iterator<Derived*>(&d));
test<random_access_iterator<const Base*> >(random_access_iterator<Derived*>(&d));
test<Base*>(&d);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const Derived *p = nullptr;
- constexpr std::reverse_iterator<const Derived *> it1 = std::make_reverse_iterator(p);
- constexpr std::reverse_iterator<const Base *> it2(it1);
- static_assert(it2.base() == p);
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp
new file mode 100644
index 0000000000000..4fb33f5426045
--- /dev/null
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <iterator>
+
+// reverse_iterator
+
+// iterator_type base() const; // constexpr since C++17
+
+#include <iterator>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+
+TEST_CONSTEXPR_CXX17 bool test() {
+ typedef bidirectional_iterator<int*> Iter;
+ int i = 0;
+ Iter iter(&i);
+ std::reverse_iterator<Iter> const reverse(iter);
+ std::reverse_iterator<Iter>::iterator_type base = reverse.base();
+ assert(base == Iter(&i));
+ return true;
+}
+
+int main(int, char**) {
+ test();
+#if TEST_STD_VER > 14
+ static_assert(test(), "");
+#endif
+ return 0;
+}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
similarity index 97%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
index f16fb2757a533..a1c40eac1569d 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opref/op_arrow.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
@@ -10,9 +10,7 @@
// reverse_iterator
-// constexpr pointer operator->() const;
-//
-// constexpr in C++17
+// pointer operator->() const; // constexpr in C++17
// Be sure to respect LWG 198:
// http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#198
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/
diff erence_type.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp
similarity index 63%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/
diff erence_type.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp
index bc20d1381379f..37a857ceefa83 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opindex/
diff erence_type.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp
@@ -11,7 +11,7 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// unspecified operator[](
diff erence_type n) const;
+// unspecified operator[](
diff erence_type n) const; // constexpr since C++17
#include <iterator>
#include <cassert>
@@ -20,31 +20,28 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, typename std::iterator_traits<It>::
diff erence_type n,
- typename std::iterator_traits<It>::value_type x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i,
+ typename std::iterator_traits<It>::
diff erence_type n,
+ typename std::iterator_traits<It>::value_type x) {
typedef typename std::iterator_traits<It>::value_type value_type;
const std::reverse_iterator<It> r(i);
value_type rr = r[n];
assert(rr == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 4, '1');
+ test(random_access_iterator<const char*>(s+5), 0, '5');
test(s+5, 4, '1');
+ test(s+5, 0, '5');
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p + 5);
- static_assert(it1[0] == '5', "");
- static_assert(it1[4] == '1', "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
similarity index 95%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
index 820ee00601454..19062d4d9aa35 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op.star/op_star.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
@@ -10,9 +10,7 @@
// reverse_iterator
-// constexpr reference operator*() const;
-//
-// constexpr in C++17
+// reference operator*() const; // constexpr in C++17
// Be sure to respect LWG 198:
// http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#198
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/
diff erence_type.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp
similarity index 67%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/
diff erence_type.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp
index ab92dc0686f5d..8c83ec1e9389f 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-=/
diff erence_type.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp
@@ -11,9 +11,7 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// constexpr reverse_iterator& operator-=(
diff erence_type n);
-//
-// constexpr in C++17
+// reverse_iterator& operator-=(
diff erence_type n); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -22,29 +20,24 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x) {
std::reverse_iterator<It> r(i);
std::reverse_iterator<It>& rr = r -= n;
assert(r.base() == x);
assert(&rr == &r);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
test(s+5, 5, s+10);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- constexpr auto it1 = std::make_reverse_iterator(p+5);
- constexpr auto it2 = std::make_reverse_iterator(p) -= 5;
- static_assert(it1 == it2, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/
diff erence_type.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp
similarity index 64%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/
diff erence_type.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp
index 229f3ca118812..e32fac9fc24fe 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+=/
diff erence_type.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp
@@ -11,9 +11,7 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// constexpr reverse_iterator& operator+=(
diff erence_type n);
-//
-// constexpr in C++17
+// reverse_iterator& operator+=(
diff erence_type n); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -22,29 +20,24 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x) {
std::reverse_iterator<It> r(i);
std::reverse_iterator<It>& rr = r += n;
assert(r.base() == x);
assert(&rr == &r);
}
-int main(int, char**)
-{
- const char* s = "1234567890";
+TEST_CONSTEXPR_CXX17 bool tests() {
+ char const* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
test(s+5, 5, s);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- constexpr auto it1 = std::make_reverse_iterator(p);
- constexpr auto it2 = std::make_reverse_iterator(p+5) += 5;
- static_assert(it1 == it2, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/
diff erence_type.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp
similarity index 59%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/
diff erence_type.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp
index 0e3a5d36210eb..f2474dd7669f2 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op-/
diff erence_type.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp
@@ -11,9 +11,7 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// constexpr reverse_iterator operator-(
diff erence_type n) const;
-//
-// constexpr in C++17
+// reverse_iterator operator-(
diff erence_type n) const; // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -22,32 +20,23 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x) {
const std::reverse_iterator<It> r(i);
std::reverse_iterator<It> rr = r - n;
assert(rr.base() == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
test(s+5, 5, s+10);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p + 5);
- constexpr RI it3 = it1 - 5;
- static_assert(it1 != it2, "");
- static_assert(it1 != it3, "");
- static_assert(it2 == it3, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/
diff erence_type.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp
similarity index 58%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/
diff erence_type.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp
index 9b30f59da9347..5673425e79675 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op+/
diff erence_type.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp
@@ -11,9 +11,7 @@
// reverse_iterator
// requires RandomAccessIterator<Iter>
-// constexpr reverse_iterator operator+(
diff erence_type n) const;
-//
-// constexpr in C++17
+// reverse_iterator operator+(
diff erence_type n) const; // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -22,32 +20,23 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x) {
const std::reverse_iterator<It> r(i);
std::reverse_iterator<It> rr = r + n;
assert(rr.base() == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
test(s+5, 5, s);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p + 5);
- constexpr RI it3 = it2 + 5;
- static_assert(it1 != it2, "");
- static_assert(it1 == it3, "");
- static_assert(it2 != it3, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp
similarity index 62%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp
index 8b9912c817343..24bedad314b7e 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/post.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp
@@ -10,9 +10,7 @@
// reverse_iterator
-// constexpr reverse_iterator operator--(int);
-//
-// constexpr in C++17
+// reverse_iterator operator--(int); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -21,34 +19,25 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, It x) {
std::reverse_iterator<It> r(i);
std::reverse_iterator<It> rr = r--;
assert(r.base() == x);
assert(rr.base() == i);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "123";
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s+2));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s+2));
test(s+1, s+2);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p+1);
- static_assert(it1 != it2, "");
- constexpr RI it3 = std::make_reverse_iterator(p) --;
- static_assert(it1 == it3, "");
- static_assert(it2 != it3, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp
similarity index 62%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp
index d7658ccfc991f..e15bfb2fd1509 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/post.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp
@@ -10,9 +10,7 @@
// reverse_iterator
-// constexpr reverse_iterator operator++(int);
-//
-// constexpr in C++17
+// reverse_iterator operator++(int); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -21,34 +19,25 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, It x) {
std::reverse_iterator<It> r(i);
std::reverse_iterator<It> rr = r++;
assert(r.base() == x);
assert(rr.base() == i);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "123";
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s));
test(s+1, s);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p+1);
- static_assert(it1 != it2, "");
- constexpr RI it3 = std::make_reverse_iterator(p+1) ++;
- static_assert(it1 != it3, "");
- static_assert(it2 == it3, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp
similarity index 60%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp
index 9ccab06e83907..2fbd530a085dc 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op--/pre.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp
@@ -10,9 +10,7 @@
// reverse_iterator
-// constexpr reverse_iterator& operator--();
-//
-// constexpr in C++17
+// reverse_iterator& operator--(); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -21,35 +19,25 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, It x) {
std::reverse_iterator<It> r(i);
std::reverse_iterator<It>& rr = --r;
assert(r.base() == x);
assert(&rr == &r);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "123";
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s+2));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s+2));
test(s+1, s+2);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p+1);
- static_assert(it1 != it2, "");
- constexpr RI it3 = -- std::make_reverse_iterator(p);
- static_assert(it1 != it3, "");
- static_assert(it2 == it3, "");
- static_assert(*(--std::make_reverse_iterator(p)) == '1', "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp
similarity index 59%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp
index edc74fab504e4..5efc8a39e22aa 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op++/pre.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp
@@ -10,9 +10,7 @@
// reverse_iterator
-// constexpr reverse_iterator& operator++();
-//
-// constexpr in C++17
+// reverse_iterator& operator++(); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -21,35 +19,25 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, It x) {
std::reverse_iterator<It> r(i);
std::reverse_iterator<It>& rr = ++r;
assert(r.base() == x);
assert(&rr == &r);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "123";
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s));
test(s+1, s);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p+1);
- static_assert(it1 != it2, "");
- constexpr RI it3 = ++ std::make_reverse_iterator(p+1);
- static_assert(it1 == it3, "");
- static_assert(it2 != it3, "");
- static_assert(*(++std::make_reverse_iterator(p+2)) == '1', "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp
similarity index 61%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp
index 822862756cbd9..401eecb2a3b83 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp
@@ -7,15 +7,13 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11
+
// <iterator>
// reverse_iterator
// template <class Iterator>
-// constexpr reverse_iterator<Iterator>
-// make_reverse_iterator(Iterator i);
-//
-// constexpr in C++17
+// reverse_iterator<Iterator> make_reverse_iterator(Iterator i); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -24,28 +22,24 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i)
-{
+TEST_CONSTEXPR_CXX17 void test(It i) {
const std::reverse_iterator<It> r = std::make_reverse_iterator(i);
assert(r.base() == i);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
- random_access_iterator<const char*>b(s);
- random_access_iterator<const char*>e(s+10);
- while ( b != e )
- test ( b++ );
+ random_access_iterator<const char*> b(s);
+ random_access_iterator<const char*> e(s+10);
+ while (b != e)
+ test (b++);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- constexpr auto it1 = std::make_reverse_iterator(p);
- static_assert(it1.base() == p, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op
diff /test.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/minus.pass.cpp
similarity index 67%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op
diff /test.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/minus.pass.cpp
index ce90123480941..889eb8c66c3ba 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op
diff /test.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/minus.pass.cpp
@@ -12,10 +12,8 @@
// template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
// requires HasMinus<Iter2, Iter1>
-// constexpr auto operator-(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y)
-// -> decltype(y.base() - x.base());
-//
-// constexpr in C++17
+// auto operator-(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y) // constexpr in C++17
+// -> decltype(y.base() - x.base());
#include <iterator>
#include <cstddef>
@@ -25,16 +23,13 @@
#include "test_iterators.h"
template <class It1, class It2>
-void
-test(It1 l, It2 r, std::ptr
diff _t x)
-{
+TEST_CONSTEXPR_CXX17 void test(It1 l, It2 r, std::ptr
diff _t x) {
const std::reverse_iterator<It1> r1(l);
const std::reverse_iterator<It2> r2(r);
assert((r1 - r2) == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
char s[3] = {0};
test(random_access_iterator<const char*>(s), random_access_iterator<char*>(s), 0);
test(random_access_iterator<char*>(s), random_access_iterator<const char*>(s+1), 1);
@@ -42,17 +37,13 @@ int main(int, char**)
test(s, s, 0);
test(s, s+1, 1);
test(s+1, s, -1);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p+1);
- static_assert( it1 - it2 == 1, "");
- static_assert( it2 - it1 == -1, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/
diff erence_type.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp
similarity index 57%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/
diff erence_type.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp
index ba38448515d78..aeb9f89dd4872 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.opsum/
diff erence_type.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp
@@ -11,10 +11,7 @@
// reverse_iterator
// template <RandomAccessIterator Iterator>
-// constexpr reverse_iterator<Iter>
-// operator+(Iter::
diff erence_type n, const reverse_iterator<Iter>& x);
-//
-// constexpr in C++17
+// reverse_iterator<Iter> operator+(Iter::
diff erence_type n, const reverse_iterator<Iter>& x); // constexpr in C++17
#include <iterator>
#include <cassert>
@@ -23,32 +20,23 @@
#include "test_iterators.h"
template <class It>
-void
-test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x)
-{
+TEST_CONSTEXPR_CXX17 void test(It i, typename std::iterator_traits<It>::
diff erence_type n, It x) {
const std::reverse_iterator<It> r(i);
std::reverse_iterator<It> rr = n + r;
assert(rr.base() == x);
}
-int main(int, char**)
-{
+TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
test(s+5, 5, s);
+ return true;
+}
+int main(int, char**) {
+ tests();
#if TEST_STD_VER > 14
- {
- constexpr const char *p = "123456789";
- typedef std::reverse_iterator<const char *> RI;
- constexpr RI it1 = std::make_reverse_iterator(p);
- constexpr RI it2 = std::make_reverse_iterator(p + 5);
- constexpr RI it3 = 5 + it2;
- static_assert(it1 != it2, "");
- static_assert(it1 == it3, "");
- static_assert(it2 != it3, "");
- }
+ static_assert(tests(), "");
#endif
-
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.compile.fail.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.compile.fail.cpp
deleted file mode 100644
index 2439a7893c937..0000000000000
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.cons/reverse_iterator.compile.fail.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// GCC 5 does not evaluate static assertions dependent on a template parameter.
-// UNSUPPORTED: gcc-5
-
-// <iterator>
-
-// reverse_iterator
-
-// template <class U>
-// requires HasConstructor<Iter, const U&>
-// reverse_iterator(const reverse_iterator<U> &u);
-
-// test requires
-
-#include <iterator>
-
-template <class It, class U>
-void
-test(U u)
-{
- std::reverse_iterator<U> r2(u);
- std::reverse_iterator<It> r1 = r2;
-}
-
-struct base {};
-struct derived {};
-
-int main(int, char**)
-{
- derived d;
-
- test<base*>(&d);
-
- return 0;
-}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.conv/tested_elsewhere.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.conv/tested_elsewhere.pass.cpp
deleted file mode 100644
index 1f764da05d6b5..0000000000000
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.conv/tested_elsewhere.pass.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.compile.fail.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.compile.fail.cpp
deleted file mode 100644
index 6facdea97e496..0000000000000
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.op=/reverse_iterator.compile.fail.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// GCC 5 does not evaluate static assertions dependent on a template parameter.
-// UNSUPPORTED: gcc-5
-
-// <iterator>
-
-// reverse_iterator
-
-// template <class U>
-// requires HasAssign<Iter, const U&>
-// reverse_iterator&
-// operator=(const reverse_iterator<U>& u);
-
-// test requires
-
-#include <iterator>
-
-template <class It, class U>
-void
-test(U u)
-{
- const std::reverse_iterator<U> r2(u);
- std::reverse_iterator<It> r1;
- r1 = r2;
-}
-
-struct base {};
-struct derived {};
-
-int main(int, char**)
-{
- derived d;
- test<base*>(&d);
-
- return 0;
-}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.requirements/nothing_to_do.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.requirements/nothing_to_do.pass.cpp
deleted file mode 100644
index 1f764da05d6b5..0000000000000
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.requirements/nothing_to_do.pass.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iterator/types.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/types.pass.cpp
similarity index 100%
rename from libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iterator/types.pass.cpp
rename to libcxx/test/std/iterators/predef.iterators/reverse.iterators/types.pass.cpp
More information about the libcxx-commits
mailing list