[llvm] 7e521ed - [ADT] Remove STLForwardCompat.h's C++17 equivalents

Joe Loser via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 11:52:00 PDT 2022


Author: Joe Loser
Date: 2022-08-12T12:50:52-06:00
New Revision: 7e521ed1aca33345ff3dbcee37f6176cdadd8caf

URL: https://github.com/llvm/llvm-project/commit/7e521ed1aca33345ff3dbcee37f6176cdadd8caf
DIFF: https://github.com/llvm/llvm-project/commit/7e521ed1aca33345ff3dbcee37f6176cdadd8caf.diff

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

As a follow-up of e8578968f684997840f680ed62bff5cad0accc13 which replaced the
callers to use the C++17 equivalents, remove the equivalents from
`STLForwardCompat.h` entirely and their corresponding tests.

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/STLForwardCompat.h b/llvm/include/llvm/ADT/STLForwardCompat.h
index 0aa577d3ee1a7..117285dab9b61 100644
--- a/llvm/include/llvm/ADT/STLForwardCompat.h
+++ b/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
 //===----------------------------------------------------------------------===//

diff  --git a/llvm/unittests/ADT/STLForwardCompatTest.cpp b/llvm/unittests/ADT/STLForwardCompatTest.cpp
index 12bf4031235db..33c261b79a440 100644
--- a/llvm/unittests/ADT/STLForwardCompatTest.cpp
+++ b/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 {};
 


        


More information about the llvm-commits mailing list