[libcxx-commits] [libcxx] 7b3ada7 - [libc++][NFC] Fix copy-paste error in the transform_view tests

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 30 06:52:35 PDT 2021


Author: Louis Dionne
Date: 2021-07-30T09:52:28-04:00
New Revision: 7b3ada712aff7254791b1c8cf905361fc478b70d

URL: https://github.com/llvm/llvm-project/commit/7b3ada712aff7254791b1c8cf905361fc478b70d
DIFF: https://github.com/llvm/llvm-project/commit/7b3ada712aff7254791b1c8cf905361fc478b70d.diff

LOG: [libc++][NFC] Fix copy-paste error in the transform_view tests

Added: 
    

Modified: 
    libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
    libcxx/test/std/ranges/range.adaptors/range.transform/types.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
index 8daf15ece88eb..95d964bc73d82 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
@@ -29,6 +29,14 @@
 #include "test_iterators.h"
 #include "types.h"
 
+template<class T, class F>
+concept ValidTransformView = requires { typename std::ranges::transform_view<T, F>; };
+
+struct BadFunction { };
+static_assert( ValidTransformView<ContiguousView, Increment>);
+static_assert(!ValidTransformView<Range, Increment>);
+static_assert(!ValidTransformView<ContiguousView, BadFunction>);
+
 template<std::ranges::range R>
 auto toUpper(R range) {
   return std::ranges::transform_view(range, [](char c) { return std::toupper(c); });

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.transform/types.h b/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
index 1f5fa646c3019..429a5ed969d91 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/types.h
@@ -7,9 +7,6 @@
 
 int globalBuff[8] = {0,1,2,3,4,5,6,7};
 
-template<class T, class F>
-concept ValidDropView = requires { typename std::ranges::transform_view<T, F>; };
-
 struct ContiguousView : std::ranges::view_base {
   int start_;
   int *ptr_;


        


More information about the libcxx-commits mailing list