Skip to content

Commit e9aee4f

Browse files
committed
Revert "[YAML] Make std::array available (#116059)"
Compilation failed on gcc hosts. This reverts commit 941f704. (llvmorg-20-init-12117-g941f704f0892)
1 parent 941f704 commit e9aee4f

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

llvm/include/llvm/Support/YAMLTraits.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,11 +2006,6 @@ struct SequenceTraits<
20062006
std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
20072007
: SequenceTraitsImpl<std::vector<T>, SequenceElementTraits<T>::flow> {};
20082008
template <typename T, unsigned N>
2009-
struct SequenceTraits<
2010-
std::array<T, N>,
2011-
std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
2012-
: SequenceTraitsImpl<std::array<T, N>, SequenceElementTraits<T>::flow> {};
2013-
template <typename T, unsigned N>
20142009
struct SequenceTraits<
20152010
SmallVector<T, N>,
20162011
std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>

llvm/unittests/Support/YAMLIOTest.cpp

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3366,15 +3366,6 @@ struct FixedArray {
33663366
int values[4];
33673367
};
33683368

3369-
struct StdArray {
3370-
StdArray() {
3371-
// Initialize to int max as a sentinel value.
3372-
for (auto &v : values)
3373-
v = std::numeric_limits<int>::max();
3374-
}
3375-
std::array<int, 4> values;
3376-
};
3377-
33783369
namespace llvm {
33793370
namespace yaml {
33803371
template <> struct MappingTraits<FixedArray> {
@@ -3383,21 +3374,11 @@ template <> struct MappingTraits<FixedArray> {
33833374
io.mapRequired("Values", array);
33843375
}
33853376
};
3386-
template <> struct MappingTraits<StdArray> {
3387-
static void mapping(IO &io, StdArray &st) {
3388-
io.mapRequired("Values", st.values);
3389-
}
3390-
};
33913377
} // namespace yaml
33923378
} // namespace llvm
33933379

3394-
using TestTypes = ::testing::Types<FixedArray, StdArray>;
3395-
3396-
template <typename T> class YAMLIO : public testing::Test {};
3397-
TYPED_TEST_SUITE(YAMLIO, TestTypes, );
3398-
3399-
TYPED_TEST(YAMLIO, FixedSizeArray) {
3400-
TypeParam faval;
3380+
TEST(YAMLIO, FixedSizeArray) {
3381+
FixedArray faval;
34013382
Input yin("---\nValues: [ 1, 2, 3, 4 ]\n...\n");
34023383
yin >> faval;
34033384

@@ -3419,9 +3400,9 @@ TYPED_TEST(YAMLIO, FixedSizeArray) {
34193400
ASSERT_EQ(serialized, expected);
34203401
}
34213402

3422-
TYPED_TEST(YAMLIO, FixedSizeArrayMismatch) {
3403+
TEST(YAMLIO, FixedSizeArrayMismatch) {
34233404
{
3424-
TypeParam faval;
3405+
FixedArray faval;
34253406
Input yin("---\nValues: [ 1, 2, 3 ]\n...\n");
34263407
yin >> faval;
34273408

@@ -3434,7 +3415,7 @@ TYPED_TEST(YAMLIO, FixedSizeArrayMismatch) {
34343415
}
34353416

34363417
{
3437-
TypeParam faval;
3418+
FixedArray faval;
34383419
Input yin("---\nValues: [ 1, 2, 3, 4, 5 ]\n...\n");
34393420
yin >> faval;
34403421

0 commit comments

Comments
 (0)