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

As a follow-up of e8578968f6 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
This commit is contained in:
Joe Loser 2022-08-12 06:59:38 -06:00
parent 0e27dfd560
commit 7e521ed1ac
No known key found for this signature in database
GPG Key ID: 1CDBEBC050EA230D
2 changed files with 0 additions and 74 deletions

View File

@ -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
//===----------------------------------------------------------------------===//

View File

@ -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 {};