[libcxx-commits] [PATCH] D99641: [libcxx] [test] Fix invocable tests on Windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 31 05:18:10 PDT 2021


mstorsjo updated this revision to Diff 334416.
mstorsjo added a comment.

Added comments about the MSVC and Clang bugs that this works around.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99641/new/

https://reviews.llvm.org/D99641

Files:
  libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
  libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp


Index: libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
===================================================================
--- libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
+++ libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
@@ -255,12 +255,21 @@
 static_assert(std::regular_invocable<multiple_overloads&>);
 static_assert(std::regular_invocable<multiple_overloads&, short>);
 static_assert(std::regular_invocable<multiple_overloads&, int>);
+#ifndef _MSC_VER
+// With MSVC 19.28 and newer, this test passes. However Clang currently only
+// mimics the old MSVC behaviour where this assert fails, regardless of what
+// version of MSVC it targets.
 static_assert(!std::regular_invocable<multiple_overloads&, long>);
+#endif
+static_assert(!std::regular_invocable<multiple_overloads&, long long>);
 static_assert(std::regular_invocable<multiple_overloads&, double>);
 static_assert(std::regular_invocable<multiple_overloads&, float>);
 static_assert(std::regular_invocable<multiple_overloads&, short&>);
 static_assert(std::regular_invocable<multiple_overloads&, int&>);
+#ifndef _MSC_VER
 static_assert(!std::regular_invocable<multiple_overloads&, long&>);
+#endif
+static_assert(!std::regular_invocable<multiple_overloads&, long long&>);
 static_assert(std::regular_invocable<multiple_overloads&, float&>);
 static_assert(std::regular_invocable<multiple_overloads&, double&>);
 } // namespace function_objects
Index: libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
===================================================================
--- libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
+++ libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
@@ -229,12 +229,21 @@
 static_assert(std::invocable<multiple_overloads&>);
 static_assert(std::invocable<multiple_overloads&, short>);
 static_assert(std::invocable<multiple_overloads&, int>);
+#ifndef _MSC_VER
+// With MSVC 19.28 and newer, this test passes. However Clang currently only
+// mimics the old MSVC behaviour where this assert fails, regardless of what
+// version of MSVC it targets.
 static_assert(!std::invocable<multiple_overloads&, long>);
+#endif
+static_assert(!std::invocable<multiple_overloads&, long long>);
 static_assert(std::invocable<multiple_overloads&, double>);
 static_assert(std::invocable<multiple_overloads&, float>);
 static_assert(std::invocable<multiple_overloads&, short&>);
 static_assert(std::invocable<multiple_overloads&, int&>);
+#ifndef _MSC_VER
 static_assert(!std::invocable<multiple_overloads&, long&>);
+#endif
+static_assert(!std::invocable<multiple_overloads&, long long>);
 static_assert(std::invocable<multiple_overloads&, float&>);
 static_assert(std::invocable<multiple_overloads&, double&>);
 } // namespace function_objects


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99641.334416.patch
Type: text/x-patch
Size: 2982 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210331/58681944/attachment.bin>


More information about the libcxx-commits mailing list