[libcxx-commits] [libcxx] 28ea218 - [libcxx] [test] Fix invocable tests on Windows

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 2 00:56:29 PDT 2021


Author: Martin Storsjö
Date: 2021-04-02T10:49:27+03:00
New Revision: 28ea218417d713bcb399e9428e4c3f8f7960feb2

URL: https://github.com/llvm/llvm-project/commit/28ea218417d713bcb399e9428e4c3f8f7960feb2
DIFF: https://github.com/llvm/llvm-project/commit/28ea218417d713bcb399e9428e4c3f8f7960feb2.diff

LOG: [libcxx] [test] Fix invocable tests on Windows

MSVC had a bug regarding preferring intergral conversions over
floating conversions. This is fixed in MSVC 19.28 and newer. Clang in
MSVC mode so far only mimics the old, buggy behaviour, but will
hopefully soon be fixed to comply with the new behaviour too
(see https://reviews.llvm.org/D99663).

Make the negative test to use a distinctly different type,
leaving checks for compiler specific bugs out of the libcxx test.

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

Added: 
    

Modified: 
    libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
    libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.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 7789c02d199ef..b485607626d55 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
@@ -229,12 +229,12 @@ struct multiple_overloads {
 static_assert(std::invocable<multiple_overloads&>);
 static_assert(std::invocable<multiple_overloads&, short>);
 static_assert(std::invocable<multiple_overloads&, int>);
-static_assert(!std::invocable<multiple_overloads&, long>);
+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&>);
-static_assert(!std::invocable<multiple_overloads&, long&>);
+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

diff  --git a/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp b/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
index dd5d34c348c53..4536dcc6c3d2f 100644
--- a/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
@@ -255,12 +255,12 @@ struct multiple_overloads {
 static_assert(std::regular_invocable<multiple_overloads&>);
 static_assert(std::regular_invocable<multiple_overloads&, short>);
 static_assert(std::regular_invocable<multiple_overloads&, int>);
-static_assert(!std::regular_invocable<multiple_overloads&, long>);
+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&>);
-static_assert(!std::regular_invocable<multiple_overloads&, long&>);
+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


        


More information about the libcxx-commits mailing list