[libcxx-commits] [libcxx] 5a3c276 - [libc++] [test] Remove IFNDR uses of std::invocable.
Arthur O'Dwyer via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jan 4 11:14:20 PST 2022
Author: Arthur O'Dwyer
Date: 2022-01-04T14:12:54-05:00
New Revision: 5a3c27636569df560d4ba9019f796d4442853d5b
URL: https://github.com/llvm/llvm-project/commit/5a3c27636569df560d4ba9019f796d4442853d5b
DIFF: https://github.com/llvm/llvm-project/commit/5a3c27636569df560d4ba9019f796d4442853d5b.diff
LOG: [libc++] [test] Remove IFNDR uses of std::invocable.
libstdc++'s implementation diagnoses these with hard errors.
Fixes #50059.
Differential Revision: https://reviews.llvm.org/D116293
Added:
Modified:
libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.compile.pass.cpp
libcxx/test/std/ranges/range.access/data.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
index dfd21a4f31333..a6ffac199ee1a 100644
--- a/libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
@@ -237,11 +237,10 @@ static_assert(!std::invocable<multiple_overloads, multiple_overloads::O>);
} // namespace function_objects
namespace pointer_to_member_functions {
-// clang-format off
template<class Member, class T, class... Args>
constexpr bool check_member_is_invocable()
{
- constexpr bool result = std::invocable<Member, T, Args...>;
+ constexpr bool result = std::invocable<Member, T&&, Args...>;
using uncv_t = std::remove_cvref_t<T>;
static_assert(std::invocable<Member, uncv_t*, Args...> == result);
static_assert(std::invocable<Member, std::unique_ptr<uncv_t>, Args...> == result);
@@ -254,7 +253,6 @@ namespace pointer_to_member_functions {
static_assert(!std::invocable<Member, S2*, Args...>);
return result;
}
-// clang-format on
static_assert(check_member_is_invocable<int S::*, S>());
static_assert(std::invocable<int S::*, S&>);
diff --git a/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.compile.pass.cpp
index 35973a793f4d3..fb152b99b5cd3 100644
--- a/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.compile.pass.cpp
@@ -263,11 +263,10 @@ static_assert(!std::regular_invocable<multiple_overloads, multiple_overloads::O>
} // namespace function_objects
namespace pointer_to_member_functions {
-// clang-format off
template<class Member, class T, class... Args>
constexpr bool check_member_is_invocable()
{
- constexpr bool result = std::regular_invocable<Member, T, Args...>;
+ constexpr bool result = std::regular_invocable<Member, T&&, Args...>;
using uncv_t = std::remove_cvref_t<T>;
static_assert(std::regular_invocable<Member, uncv_t*, Args...> == result);
static_assert(std::regular_invocable<Member, std::unique_ptr<uncv_t>, Args...> == result);
@@ -280,7 +279,6 @@ namespace pointer_to_member_functions {
static_assert(!std::regular_invocable<Member, S2*, Args...>);
return result;
}
-// clang-format on
static_assert(check_member_is_invocable<int S::*, S>());
static_assert(std::regular_invocable<int S::*, S&>);
diff --git a/libcxx/test/std/ranges/range.access/data.pass.cpp b/libcxx/test/std/ranges/range.access/data.pass.cpp
index b02c82306bcb8..4e03dc4d8bd7c 100644
--- a/libcxx/test/std/ranges/range.access/data.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/data.pass.cpp
@@ -25,8 +25,8 @@ static int globalBuff[2];
struct Incomplete;
static_assert(!std::is_invocable_v<RangeDataT, Incomplete[]>);
-static_assert(!std::is_invocable_v<RangeDataT, Incomplete[2]>);
-static_assert(!std::is_invocable_v<RangeDataT, Incomplete[2][2]>);
+static_assert(!std::is_invocable_v<RangeDataT, Incomplete(&&)[2]>);
+static_assert(!std::is_invocable_v<RangeDataT, Incomplete(&&)[2][2]>);
static_assert(!std::is_invocable_v<RangeDataT, int [1]>);
static_assert(!std::is_invocable_v<RangeDataT, int (&&)[1]>);
static_assert( std::is_invocable_v<RangeDataT, int (&)[1]>);
More information about the libcxx-commits
mailing list