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

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 30 23:43:22 PDT 2021


mstorsjo created this revision.
mstorsjo added a reviewer: cjdb.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

When operating in MSVC mode, the !std::invocable<multiple_overloads&, long>
check fails - apparently MSVC mode has slightly different rules
regarding long vs int than other compilers/modes. In MinGW mode, those
checks behave as they were expected and intended to. Ifdef out those cases
when building in MSVC mode.

Add new negative tests like the ones ifdeffed out, with a type (long long)
that fails the tests as expected even in MSVC mode.


Repository:
  rG LLVM Github Monorepo

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,18 @@
 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
 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,18 @@
 static_assert(std::invocable<multiple_overloads&>);
 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&, 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.334361.patch
Type: text/x-patch
Size: 2606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210331/6d0da678/attachment.bin>


More information about the libcxx-commits mailing list