Skip to content

Commit 7e521ed

Browse files
committed
[ADT] Remove STLForwardCompat.h's C++17 equivalents
As a follow-up of e857896 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
1 parent 0e27dfd commit 7e521ed

File tree

2 files changed

+0
-74
lines changed

2 files changed

+0
-74
lines changed

llvm/include/llvm/ADT/STLForwardCompat.h

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,49 +21,6 @@
2121

2222
namespace llvm {
2323

24-
//===----------------------------------------------------------------------===//
25-
// Features from C++17
26-
//===----------------------------------------------------------------------===//
27-
28-
template <typename T>
29-
struct negation // NOLINT(readability-identifier-naming)
30-
: std::integral_constant<bool, !bool(T::value)> {};
31-
32-
template <typename...>
33-
struct conjunction // NOLINT(readability-identifier-naming)
34-
: std::true_type {};
35-
template <typename B1> struct conjunction<B1> : B1 {};
36-
template <typename B1, typename... Bn>
37-
struct conjunction<B1, Bn...>
38-
: std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {};
39-
40-
template <typename...>
41-
struct disjunction // NOLINT(readability-identifier-naming)
42-
: std::false_type {};
43-
template <typename B1> struct disjunction<B1> : B1 {};
44-
template <typename B1, typename... Bn>
45-
struct disjunction<B1, Bn...>
46-
: std::conditional<bool(B1::value), B1, disjunction<Bn...>>::type {};
47-
48-
struct in_place_t // NOLINT(readability-identifier-naming)
49-
{
50-
explicit in_place_t() = default;
51-
};
52-
/// \warning This must not be odr-used, as it cannot be made \c inline in C++14.
53-
constexpr in_place_t in_place; // NOLINT(readability-identifier-naming)
54-
55-
template <typename T>
56-
struct in_place_type_t // NOLINT(readability-identifier-naming)
57-
{
58-
explicit in_place_type_t() = default;
59-
};
60-
61-
template <std::size_t I>
62-
struct in_place_index_t // NOLINT(readability-identifier-naming)
63-
{
64-
explicit in_place_index_t() = default;
65-
};
66-
6724
//===----------------------------------------------------------------------===//
6825
// Features from C++20
6926
//===----------------------------------------------------------------------===//

llvm/unittests/ADT/STLForwardCompatTest.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,6 @@
1111

1212
namespace {
1313

14-
TEST(STLForwardCompatTest, NegationTest) {
15-
EXPECT_TRUE((llvm::negation<std::false_type>::value));
16-
EXPECT_FALSE((llvm::negation<std::true_type>::value));
17-
}
18-
19-
struct incomplete_type;
20-
21-
TEST(STLForwardCompatTest, ConjunctionTest) {
22-
EXPECT_TRUE((llvm::conjunction<>::value));
23-
EXPECT_FALSE((llvm::conjunction<std::false_type>::value));
24-
EXPECT_TRUE((llvm::conjunction<std::true_type>::value));
25-
EXPECT_FALSE((llvm::conjunction<std::false_type, incomplete_type>::value));
26-
EXPECT_FALSE((llvm::conjunction<std::false_type, std::true_type>::value));
27-
EXPECT_FALSE((llvm::conjunction<std::true_type, std::false_type>::value));
28-
EXPECT_TRUE((llvm::conjunction<std::true_type, std::true_type>::value));
29-
EXPECT_TRUE((llvm::conjunction<std::true_type, std::true_type,
30-
std::true_type>::value));
31-
}
32-
33-
TEST(STLForwardCompatTest, DisjunctionTest) {
34-
EXPECT_FALSE((llvm::disjunction<>::value));
35-
EXPECT_FALSE((llvm::disjunction<std::false_type>::value));
36-
EXPECT_TRUE((llvm::disjunction<std::true_type>::value));
37-
EXPECT_TRUE((llvm::disjunction<std::true_type, incomplete_type>::value));
38-
EXPECT_TRUE((llvm::disjunction<std::false_type, std::true_type>::value));
39-
EXPECT_TRUE((llvm::disjunction<std::true_type, std::false_type>::value));
40-
EXPECT_TRUE((llvm::disjunction<std::true_type, std::true_type>::value));
41-
EXPECT_TRUE((llvm::disjunction<std::true_type, std::true_type,
42-
std::true_type>::value));
43-
}
44-
4514
template <typename T>
4615
class STLForwardCompatRemoveCVRefTest : public ::testing::Test {};
4716

0 commit comments

Comments
 (0)