This revision was automatically updated to reflect the committed changes. Closed by commit rG8615ce246d1c: [libc++][test] Adjust move_iterator tests to allow C++20 (authored by CaseyCarter).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79343/new/ https://reviews.llvm.org/D79343 Files: libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp Index: libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp @@ -35,6 +35,8 @@ typedef std::ptrdiff_t difference_type; typedef ValueType* pointer; typedef Reference reference; + + Reference operator*() const; }; template <class It> Index: libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp @@ -16,10 +16,20 @@ #include <iterator> #include <cassert> +#include <utility> #include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +template <class It> +void test_single_pass(It i, It x) { + std::move_iterator<It> r(std::move(i)); + r++; + assert(std::move(r).base() == x); +} +#endif + template <class It> void test(It i, It x) @@ -33,7 +43,11 @@ int main(int, char**) { char s[] = "123"; +#if TEST_STD_VER > 17 + test_single_pass(input_iterator<char*>(s), input_iterator<char*>(s + 1)); +#else test(input_iterator<char*>(s), input_iterator<char*>(s+1)); +#endif test(forward_iterator<char*>(s), forward_iterator<char*>(s+1)); test(bidirectional_iterator<char*>(s), bidirectional_iterator<char*>(s+1)); test(random_access_iterator<char*>(s), random_access_iterator<char*>(s+1));
Index: libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp @@ -35,6 +35,8 @@ typedef std::ptrdiff_t difference_type; typedef ValueType* pointer; typedef Reference reference; + + Reference operator*() const; }; template <class It> Index: libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp =================================================================== --- libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp +++ libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.incr/post.pass.cpp @@ -16,10 +16,20 @@ #include <iterator> #include <cassert> +#include <utility> #include "test_macros.h" #include "test_iterators.h" +#if TEST_STD_VER > 17 +template <class It> +void test_single_pass(It i, It x) { + std::move_iterator<It> r(std::move(i)); + r++; + assert(std::move(r).base() == x); +} +#endif + template <class It> void test(It i, It x) @@ -33,7 +43,11 @@ int main(int, char**) { char s[] = "123"; +#if TEST_STD_VER > 17 + test_single_pass(input_iterator<char*>(s), input_iterator<char*>(s + 1)); +#else test(input_iterator<char*>(s), input_iterator<char*>(s+1)); +#endif test(forward_iterator<char*>(s), forward_iterator<char*>(s+1)); test(bidirectional_iterator<char*>(s), bidirectional_iterator<char*>(s+1)); test(random_access_iterator<char*>(s), random_access_iterator<char*>(s+1));
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits