[libcxx-commits] [libcxx] 1fd3173 - [NFC][libc++] Removes concepts tests.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 31 06:00:34 PST 2022


Author: Mark de Wever
Date: 2022-12-31T15:00:29+01:00
New Revision: 1fd3173e02a7c55ae84c8489c54ba975f207a074

URL: https://github.com/llvm/llvm-project/commit/1fd3173e02a7c55ae84c8489c54ba975f207a074
DIFF: https://github.com/llvm/llvm-project/commit/1fd3173e02a7c55ae84c8489c54ba975f207a074.diff

LOG: [NFC][libc++] Removes concepts tests.

Concepts should be supported by all supported compilers. This is
probably a left over from an older version of the expected patch.

Reviewed By: #libc, philnik

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

Added: 
    

Modified: 
    libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp
    libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.move.pass.cpp
    libcxx/test/std/utilities/expected/expected.expected/dtor.pass.cpp
    libcxx/test/std/utilities/expected/expected.void/ctor/ctor.copy.pass.cpp
    libcxx/test/std/utilities/expected/expected.void/ctor/ctor.move.pass.cpp
    libcxx/test/std/utilities/expected/expected.void/dtor.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp b/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp
index 0b3451e3f192d..77d73485025ab 100644
--- a/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp
+++ b/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp
@@ -56,9 +56,7 @@ static_assert(!std::is_copy_constructible_v<std::expected<NonCopyable, NonCopyab
 // Test: This constructor is trivial if
 // - is_trivially_copy_constructible_v<T> is true and
 // - is_trivially_copy_constructible_v<E> is true.
-#if __cpp_concepts >= 202002
 static_assert(std::is_trivially_copy_constructible_v<std::expected<int, int>>);
-#endif
 static_assert(!std::is_trivially_copy_constructible_v<std::expected<CopyableNonTrivial, int>>);
 static_assert(!std::is_trivially_copy_constructible_v<std::expected<int, CopyableNonTrivial>>);
 static_assert(!std::is_trivially_copy_constructible_v<std::expected<CopyableNonTrivial, CopyableNonTrivial>>);

diff  --git a/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.move.pass.cpp b/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.move.pass.cpp
index 4ee5edd07a484..5e6749e50c16c 100644
--- a/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.move.pass.cpp
+++ b/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.move.pass.cpp
@@ -62,9 +62,7 @@ static_assert(!std::is_move_constructible_v<std::expected<NonMovable, NonMovable
 // Test: This constructor is trivial if
 // - is_trivially_move_constructible_v<T> is true and
 // - is_trivially_move_constructible_v<E> is true.
-#if __cpp_concepts >= 202002
 static_assert(std::is_trivially_move_constructible_v<std::expected<int, int>>);
-#endif
 static_assert(!std::is_trivially_move_constructible_v<std::expected<MovableNonTrivial, int>>);
 static_assert(!std::is_trivially_move_constructible_v<std::expected<int, MovableNonTrivial>>);
 static_assert(!std::is_trivially_move_constructible_v<std::expected<MovableNonTrivial, MovableNonTrivial>>);

diff  --git a/libcxx/test/std/utilities/expected/expected.expected/dtor.pass.cpp b/libcxx/test/std/utilities/expected/expected.expected/dtor.pass.cpp
index b758fe0b2bcb4..6abbe51984d2a 100644
--- a/libcxx/test/std/utilities/expected/expected.expected/dtor.pass.cpp
+++ b/libcxx/test/std/utilities/expected/expected.expected/dtor.pass.cpp
@@ -21,6 +21,7 @@
 #include <expected>
 #include <type_traits>
 #include <utility>
+#include <memory>
 
 #include "test_macros.h"
 
@@ -30,9 +31,7 @@ struct NonTrivial {
   ~NonTrivial() {}
 };
 
-#if __cpp_concepts >= 202002
 static_assert(std::is_trivially_destructible_v<std::expected<int, int>>);
-#endif
 static_assert(!std::is_trivially_destructible_v<std::expected<NonTrivial, int>>);
 static_assert(!std::is_trivially_destructible_v<std::expected<int, NonTrivial>>);
 static_assert(!std::is_trivially_destructible_v<std::expected<NonTrivial, NonTrivial>>);
@@ -62,6 +61,8 @@ constexpr bool test() {
 }
 
 int main(int, char**) {
+  std::expected<std::unique_ptr<int>, int> a = std::make_unique<int>(42);
+
   test();
   static_assert(test());
   return 0;

diff  --git a/libcxx/test/std/utilities/expected/expected.void/ctor/ctor.copy.pass.cpp b/libcxx/test/std/utilities/expected/expected.void/ctor/ctor.copy.pass.cpp
index f11fb737aea31..689f152a3ac55 100644
--- a/libcxx/test/std/utilities/expected/expected.void/ctor/ctor.copy.pass.cpp
+++ b/libcxx/test/std/utilities/expected/expected.void/ctor/ctor.copy.pass.cpp
@@ -43,9 +43,7 @@ static_assert(std::is_copy_constructible_v<std::expected<void, CopyableNonTrivia
 static_assert(!std::is_copy_constructible_v<std::expected<void, NonCopyable>>);
 
 // Test: This constructor is trivial if is_trivially_copy_constructible_v<E> is true.
-#if __cpp_concepts >= 202002
 static_assert(std::is_trivially_copy_constructible_v<std::expected<void, int>>);
-#endif
 static_assert(!std::is_trivially_copy_constructible_v<std::expected<void, CopyableNonTrivial>>);
 
 constexpr bool test() {

diff  --git a/libcxx/test/std/utilities/expected/expected.void/ctor/ctor.move.pass.cpp b/libcxx/test/std/utilities/expected/expected.void/ctor/ctor.move.pass.cpp
index f1c42f44528a5..61bce2be4897f 100644
--- a/libcxx/test/std/utilities/expected/expected.void/ctor/ctor.move.pass.cpp
+++ b/libcxx/test/std/utilities/expected/expected.void/ctor/ctor.move.pass.cpp
@@ -48,9 +48,7 @@ static_assert(std::is_move_constructible_v<std::expected<void, MovableNonTrivial
 static_assert(!std::is_move_constructible_v<std::expected<void, NonMovable>>);
 
 // Test: This constructor is trivial if is_trivially_move_constructible_v<E> is true.
-#if __cpp_concepts >= 202002
 static_assert(std::is_trivially_move_constructible_v<std::expected<void, int>>);
-#endif
 static_assert(!std::is_trivially_move_constructible_v<std::expected<void, MovableNonTrivial>>);
 
 // Test: noexcept(is_nothrow_move_constructible_v<E>)

diff  --git a/libcxx/test/std/utilities/expected/expected.void/dtor.pass.cpp b/libcxx/test/std/utilities/expected/expected.void/dtor.pass.cpp
index 855d585756317..8ca92ece44a57 100644
--- a/libcxx/test/std/utilities/expected/expected.void/dtor.pass.cpp
+++ b/libcxx/test/std/utilities/expected/expected.void/dtor.pass.cpp
@@ -27,9 +27,7 @@ struct NonTrivial {
   ~NonTrivial() {}
 };
 
-#if __cpp_concepts >= 202002
 static_assert(std::is_trivially_destructible_v<std::expected<void, int>>);
-#endif
 static_assert(!std::is_trivially_destructible_v<std::expected<void, NonTrivial>>);
 
 struct TrackedDestroy {


        


More information about the libcxx-commits mailing list