[libcxx-commits] [libcxx] 3f143a1 - [libcxx] updates regular_invocable test to actually test regular_invocable

Christopher Di Bella via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 24 23:34:42 PDT 2021


Author: Christopher Di Bella
Date: 2021-03-25T06:33:48Z
New Revision: 3f143a10cc4fd7cd4a24b8bb380370d35bc58a2c

URL: https://github.com/llvm/llvm-project/commit/3f143a10cc4fd7cd4a24b8bb380370d35bc58a2c
DIFF: https://github.com/llvm/llvm-project/commit/3f143a10cc4fd7cd4a24b8bb380370d35bc58a2c.diff

LOG: [libcxx] updates regular_invocable test to actually test regular_invocable

The test wasn't previously testing this concept, but its base.

Differential Revision: https://reviews.llvm.org/D99306

Added: 
    

Modified: 
    libcxx/test/std/concepts/callable/invocable.compile.pass.cpp
    libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp b/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp
index cd415d8d0998..7bda033f85bd 100644
--- a/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp
@@ -20,13 +20,15 @@
 
 #include "functions.h"
 
+// clang-format off
 template <class F, class... Args>
-requires std::invocable<F, Args...> constexpr void
-ModelsInvocable(F, Args&&...) noexcept{};
+requires std::invocable<F, Args...>
+constexpr void ModelsInvocable(F, Args&&...) noexcept{}
 
 template <class F, class... Args>
-requires(!std::invocable<F, Args...>) constexpr
-    void NotInvocable(F, Args&&...) noexcept {}
+requires(!std::invocable<F, Args...>)
+constexpr void NotInvocable(F, Args&&...) noexcept {}
+// clang-format on
 
 static_assert(!std::invocable<void>);
 static_assert(!std::invocable<void*>);

diff  --git a/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp b/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp
index b085b7e50022..4e0da4376176 100644
--- a/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp
@@ -19,19 +19,21 @@
 
 #include "functions.h"
 
+// clang-format off
 template <class F, class... Args>
-requires std::invocable<F, Args...> constexpr void
-ModelsRegularInvocable(F, Args&&...) noexcept{};
+requires std::regular_invocable<F, Args...>
+constexpr void ModelsRegularInvocable(F, Args&&...) noexcept {}
 
 template <class F, class... Args>
-requires(!std::invocable<F, Args...>) constexpr
-    void NotRegularInvocable(F, Args&&...) noexcept {}
+requires (!std::regular_invocable<F, Args...>)
+constexpr void NotRegularInvocable(F, Args&&...) noexcept {}
+// clang-format on
 
-static_assert(!std::invocable<void>);
-static_assert(!std::invocable<void*>);
-static_assert(!std::invocable<int>);
-static_assert(!std::invocable<int&>);
-static_assert(!std::invocable<int&&>);
+static_assert(!std::regular_invocable<void>);
+static_assert(!std::regular_invocable<void*>);
+static_assert(!std::regular_invocable<int>);
+static_assert(!std::regular_invocable<int&>);
+static_assert(!std::regular_invocable<int&&>);
 
 int main(int, char**) {
   {


        


More information about the libcxx-commits mailing list