[PATCH] D131769: [ADT] Remove STLForwardCompat.h's C++17 equivalents

Joe Loser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 06:01:59 PDT 2022


jloser created this revision.
jloser added reviewers: scott.linder, MaskRay, dblaikie.
Herald added a subscriber: StephenFan.
Herald added a project: All.
jloser requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

As a follow-up of e8578968f684997840f680ed62bff5cad0accc13 <https://reviews.llvm.org/rGe8578968f684997840f680ed62bff5cad0accc13> which replaced the
callers to use the C++17 equivalents, remove the equivalents from
STLForwardCompat.h entirely and their corresponding tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131769

Files:
  llvm/include/llvm/ADT/STLForwardCompat.h
  llvm/unittests/ADT/STLForwardCompatTest.cpp


Index: llvm/unittests/ADT/STLForwardCompatTest.cpp
===================================================================
--- llvm/unittests/ADT/STLForwardCompatTest.cpp
+++ llvm/unittests/ADT/STLForwardCompatTest.cpp
@@ -11,37 +11,6 @@
 
 namespace {
 
-TEST(STLForwardCompatTest, NegationTest) {
-  EXPECT_TRUE((llvm::negation<std::false_type>::value));
-  EXPECT_FALSE((llvm::negation<std::true_type>::value));
-}
-
-struct incomplete_type;
-
-TEST(STLForwardCompatTest, ConjunctionTest) {
-  EXPECT_TRUE((llvm::conjunction<>::value));
-  EXPECT_FALSE((llvm::conjunction<std::false_type>::value));
-  EXPECT_TRUE((llvm::conjunction<std::true_type>::value));
-  EXPECT_FALSE((llvm::conjunction<std::false_type, incomplete_type>::value));
-  EXPECT_FALSE((llvm::conjunction<std::false_type, std::true_type>::value));
-  EXPECT_FALSE((llvm::conjunction<std::true_type, std::false_type>::value));
-  EXPECT_TRUE((llvm::conjunction<std::true_type, std::true_type>::value));
-  EXPECT_TRUE((llvm::conjunction<std::true_type, std::true_type,
-                                 std::true_type>::value));
-}
-
-TEST(STLForwardCompatTest, DisjunctionTest) {
-  EXPECT_FALSE((llvm::disjunction<>::value));
-  EXPECT_FALSE((llvm::disjunction<std::false_type>::value));
-  EXPECT_TRUE((llvm::disjunction<std::true_type>::value));
-  EXPECT_TRUE((llvm::disjunction<std::true_type, incomplete_type>::value));
-  EXPECT_TRUE((llvm::disjunction<std::false_type, std::true_type>::value));
-  EXPECT_TRUE((llvm::disjunction<std::true_type, std::false_type>::value));
-  EXPECT_TRUE((llvm::disjunction<std::true_type, std::true_type>::value));
-  EXPECT_TRUE((llvm::disjunction<std::true_type, std::true_type,
-                                 std::true_type>::value));
-}
-
 template <typename T>
 class STLForwardCompatRemoveCVRefTest : public ::testing::Test {};
 
Index: llvm/include/llvm/ADT/STLForwardCompat.h
===================================================================
--- llvm/include/llvm/ADT/STLForwardCompat.h
+++ llvm/include/llvm/ADT/STLForwardCompat.h
@@ -21,49 +21,6 @@
 
 namespace llvm {
 
-//===----------------------------------------------------------------------===//
-//     Features from C++17
-//===----------------------------------------------------------------------===//
-
-template <typename T>
-struct negation // NOLINT(readability-identifier-naming)
-    : std::integral_constant<bool, !bool(T::value)> {};
-
-template <typename...>
-struct conjunction // NOLINT(readability-identifier-naming)
-    : std::true_type {};
-template <typename B1> struct conjunction<B1> : B1 {};
-template <typename B1, typename... Bn>
-struct conjunction<B1, Bn...>
-    : std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {};
-
-template <typename...>
-struct disjunction // NOLINT(readability-identifier-naming)
-    : std::false_type {};
-template <typename B1> struct disjunction<B1> : B1 {};
-template <typename B1, typename... Bn>
-struct disjunction<B1, Bn...>
-    : std::conditional<bool(B1::value), B1, disjunction<Bn...>>::type {};
-
-struct in_place_t // NOLINT(readability-identifier-naming)
-{
-  explicit in_place_t() = default;
-};
-/// \warning This must not be odr-used, as it cannot be made \c inline in C++14.
-constexpr in_place_t in_place; // NOLINT(readability-identifier-naming)
-
-template <typename T>
-struct in_place_type_t // NOLINT(readability-identifier-naming)
-{
-  explicit in_place_type_t() = default;
-};
-
-template <std::size_t I>
-struct in_place_index_t // NOLINT(readability-identifier-naming)
-{
-  explicit in_place_index_t() = default;
-};
-
 //===----------------------------------------------------------------------===//
 //     Features from C++20
 //===----------------------------------------------------------------------===//


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131769.452166.patch
Type: text/x-patch
Size: 3792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220812/cf0d1f35/attachment.bin>


More information about the llvm-commits mailing list