[libcxx-commits] [libcxx] 009791e - [libcxx][test] optional's comparisons with optional are not portably constrained
Casey Carter via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 9 14:00:29 PST 2022
Author: Casey Carter
Date: 2022-02-09T14:00:24-08:00
New Revision: 009791e0dbc608aafe0ae4d15fcc9fafb7e4a135
URL: https://github.com/llvm/llvm-project/commit/009791e0dbc608aafe0ae4d15fcc9fafb7e4a135
DIFF: https://github.com/llvm/llvm-project/commit/009791e0dbc608aafe0ae4d15fcc9fafb7e4a135.diff
LOG: [libcxx][test] optional's comparisons with optional are not portably constrained
so use them as concept test cases only with libc++.
Differential Revision: https://reviews.llvm.org/D116884
Added:
Modified:
libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
index 59bab226e5f38..222b5a6de4a7a 100644
--- a/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
@@ -26,10 +26,6 @@
#include <unordered_set>
#include <vector>
-#ifndef _LIBCPP_HAS_NO_THREADS
-# include <mutex>
-#endif
-
#include "compare_types.h"
namespace fundamentals {
@@ -87,26 +83,17 @@ static_assert(!std::equality_comparable<void>);
} // namespace fundamentals
namespace standard_types {
-static_assert(std::equality_comparable<std::array<int, 10> >);
-static_assert(std::equality_comparable<std::deque<int> >);
-static_assert(std::equality_comparable<std::forward_list<int> >);
-static_assert(std::equality_comparable<std::list<int> >);
-
-#ifndef _LIBCPP_HAS_NO_THREADS
-static_assert(!std::equality_comparable<std::lock_guard<std::mutex> >);
-static_assert(std::equality_comparable<std::map<int, void*> >);
-static_assert(!std::equality_comparable<std::mutex>);
-static_assert(
- !std::equality_comparable<std::optional<std::lock_guard<std::mutex> > >);
-static_assert(!std::equality_comparable<std::optional<std::mutex> >);
-#endif
-
-static_assert(std::equality_comparable<std::optional<int> >);
-static_assert(std::equality_comparable<std::set<int> >);
-static_assert(std::equality_comparable<std::unordered_map<int, void*> >);
-static_assert(std::equality_comparable<std::unordered_set<int> >);
-static_assert(std::equality_comparable<std::vector<bool> >);
-static_assert(std::equality_comparable<std::vector<int> >);
+static_assert(std::equality_comparable<std::array<int, 10>>);
+static_assert(std::equality_comparable<std::deque<int>>);
+static_assert(std::equality_comparable<std::forward_list<int>>);
+static_assert(std::equality_comparable<std::list<int>>);
+static_assert(std::equality_comparable<std::map<int, void*>>);
+static_assert(std::equality_comparable<std::optional<int>>);
+static_assert(std::equality_comparable<std::set<int>>);
+static_assert(std::equality_comparable<std::unordered_map<int, void*>>);
+static_assert(std::equality_comparable<std::unordered_set<int>>);
+static_assert(std::equality_comparable<std::vector<bool>>);
+static_assert(std::equality_comparable<std::vector<int>>);
} // namespace standard_types
namespace types_fit_for_purpose {
diff --git a/libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp b/libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp
index 03d82ec97557e..168a8458b00bc 100644
--- a/libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp
@@ -117,7 +117,6 @@ struct A {};
// static_assert(!std::totally_ordered<std::deque<A> >);
// static_assert(!std::totally_ordered<std::forward_list<A> >);
// static_assert(!std::totally_ordered<std::list<A> >);
-static_assert(!std::totally_ordered<std::optional<A> >);
// static_assert(!std::totally_ordered<std::set<A> >);
// static_assert(!std::totally_ordered<std::vector<A> >);
} // namespace standard_types
More information about the libcxx-commits
mailing list