Skip to content

Commit f2f373d

Browse files
committed
[libc++] Update the CI to Clang-20 and drop Clang-17 support
1 parent aaa0dd2 commit f2f373d

File tree

32 files changed

+29
-162
lines changed

32 files changed

+29
-162
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
'generic-cxx26',
4848
'generic-modules'
4949
]
50-
cc: [ 'clang-19' ]
51-
cxx: [ 'clang++-19' ]
50+
cc: [ 'clang-20' ]
51+
cxx: [ 'clang++-20' ]
5252
include:
5353
- config: 'generic-gcc'
5454
cc: 'gcc-14'
@@ -87,18 +87,18 @@ jobs:
8787
'generic-cxx20',
8888
'generic-cxx23'
8989
]
90-
cc: [ 'clang-19' ]
91-
cxx: [ 'clang++-19' ]
90+
cc: [ 'clang-20' ]
91+
cxx: [ 'clang++-20' ]
9292
include:
9393
- config: 'generic-gcc-cxx11'
9494
cc: 'gcc-14'
9595
cxx: 'g++-14'
9696
- config: 'generic-cxx23'
97-
cc: 'clang-17'
98-
cxx: 'clang++-17'
99-
- config: 'generic-cxx26'
10097
cc: 'clang-18'
10198
cxx: 'clang++-18'
99+
- config: 'generic-cxx26'
100+
cc: 'clang-19'
101+
cxx: 'clang++-19'
102102
steps:
103103
- uses: actions/checkout@v4
104104
- name: ${{ matrix.config }}
@@ -168,8 +168,8 @@ jobs:
168168
- name: ${{ matrix.config }}
169169
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
170170
env:
171-
CC: clang-19
172-
CXX: clang++-19
171+
CC: clang-20
172+
CXX: clang++-20
173173
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
174174
if: always()
175175
with:

libcxx/include/__configuration/compiler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
// Warn if a compiler version is used that is not supported anymore
3434
// LLVM RELEASE Update the minimum compiler versions
3535
# if defined(_LIBCPP_CLANG_VER)
36-
# if _LIBCPP_CLANG_VER < 1700
37-
# warning "Libc++ only supports Clang 17 and later"
36+
# if _LIBCPP_CLANG_VER < 1800
37+
# warning "Libc++ only supports Clang 18 and later"
3838
# endif
3939
# elif defined(_LIBCPP_APPLE_CLANG_VER)
4040
# if _LIBCPP_APPLE_CLANG_VER < 1500

libcxx/include/__type_traits/promote.h

Lines changed: 2 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@
1313
#include <__type_traits/integral_constant.h>
1414
#include <__type_traits/is_arithmetic.h>
1515

16-
#if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER == 1700
17-
# include <__type_traits/is_same.h>
18-
# include <__utility/declval.h>
19-
#endif
20-
2116
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2217
# pragma GCC system_header
2318
#endif
2419

2520
_LIBCPP_BEGIN_NAMESPACE_STD
2621

27-
// TODO(LLVM-20): Remove this workaround
28-
#if !defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER != 1700
29-
3022
template <class... _Args>
3123
class __promote {
3224
static_assert((is_arithmetic<_Args>::value && ...));
@@ -39,90 +31,17 @@ class __promote {
3931
static double __test(unsigned long);
4032
static double __test(long long);
4133
static double __test(unsigned long long);
42-
# if _LIBCPP_HAS_INT128
34+
#if _LIBCPP_HAS_INT128
4335
static double __test(__int128_t);
4436
static double __test(__uint128_t);
45-
# endif
37+
#endif
4638
static double __test(double);
4739
static long double __test(long double);
4840

4941
public:
5042
using type = decltype((__test(_Args()) + ...));
5143
};
5244

53-
#else
54-
55-
template <class _Tp>
56-
struct __numeric_type {
57-
static void __test(...);
58-
static float __test(float);
59-
static double __test(char);
60-
static double __test(int);
61-
static double __test(unsigned);
62-
static double __test(long);
63-
static double __test(unsigned long);
64-
static double __test(long long);
65-
static double __test(unsigned long long);
66-
# if _LIBCPP_HAS_INT128
67-
static double __test(__int128_t);
68-
static double __test(__uint128_t);
69-
# endif
70-
static double __test(double);
71-
static long double __test(long double);
72-
73-
typedef decltype(__test(std::declval<_Tp>())) type;
74-
static const bool value = _IsNotSame<type, void>::value;
75-
};
76-
77-
template <>
78-
struct __numeric_type<void> {
79-
static const bool value = true;
80-
};
81-
82-
template <class _A1,
83-
class _A2 = void,
84-
class _A3 = void,
85-
bool = __numeric_type<_A1>::value && __numeric_type<_A2>::value && __numeric_type<_A3>::value>
86-
class __promote_imp {
87-
public:
88-
static const bool value = false;
89-
};
90-
91-
template <class _A1, class _A2, class _A3>
92-
class __promote_imp<_A1, _A2, _A3, true> {
93-
private:
94-
typedef typename __promote_imp<_A1>::type __type1;
95-
typedef typename __promote_imp<_A2>::type __type2;
96-
typedef typename __promote_imp<_A3>::type __type3;
97-
98-
public:
99-
typedef decltype(__type1() + __type2() + __type3()) type;
100-
static const bool value = true;
101-
};
102-
103-
template <class _A1, class _A2>
104-
class __promote_imp<_A1, _A2, void, true> {
105-
private:
106-
typedef typename __promote_imp<_A1>::type __type1;
107-
typedef typename __promote_imp<_A2>::type __type2;
108-
109-
public:
110-
typedef decltype(__type1() + __type2()) type;
111-
static const bool value = true;
112-
};
113-
114-
template <class _A1>
115-
class __promote_imp<_A1, void, void, true> {
116-
public:
117-
typedef typename __numeric_type<_A1>::type type;
118-
static const bool value = true;
119-
};
120-
121-
template <class _A1, class _A2 = void, class _A3 = void>
122-
class __promote : public __promote_imp<_A1, _A2, _A3> {};
123-
124-
#endif // !defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER >= 1700
125-
12645
_LIBCPP_END_NAMESPACE_STD
12746

12847
#endif // _LIBCPP___TYPE_TRAITS_PROMOTE_H

libcxx/src/experimental/time_zone.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ __format(const __tz::__continuation& __continuation, const string& __letters, se
199199
// active at the end. This should be determined separately.
200200
return chrono::seconds{0};
201201
else
202-
static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support
202+
static_assert(false);
203203

204204
std::__libcpp_unreachable();
205205
},
@@ -225,7 +225,7 @@ __format(const __tz::__continuation& __continuation, const string& __letters, se
225225
else if constexpr (same_as<_Tp, __tz::__constrained_weekday>)
226226
return __value(__year, __month);
227227
else
228-
static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support
228+
static_assert(false);
229229

230230
std::__libcpp_unreachable();
231231
},
@@ -688,7 +688,7 @@ __get_sys_info(sys_seconds __time,
688688
else if constexpr (same_as<_Tp, __tz::__save>)
689689
return chrono::__get_sys_info_basic(__time, __continuation_begin, __continuation, __value.__time);
690690
else
691-
static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support
691+
static_assert(false);
692692

693693
std::__libcpp_unreachable();
694694
},

libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// This test fails with Clang <18 because diagnose_if doesn't emit all of the
10-
// diagnostics when -fdelayed-template-parsing is enabled, like it is in MSVC
11-
// mode.
12-
// XFAIL: msvc && clang-17
13-
149
// REQUIRES: diagnose-if-support
1510

1611
// <atomic>

libcxx/test/libcxx/clang_tidy.gen.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
// The GCC compiler flags are not always compatible with clang-tidy.
2727
// UNSUPPORTED: gcc
2828
29-
// Clang 17 has false positives.
30-
// UNSUPPORTED: clang-17
31-
3229
{lit_header_restrictions.get(header, '')}
3330
3431
// TODO: run clang-tidy with modules enabled once they are supported

libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// UNSUPPORTED: c++03
1313

1414
// TODO: Investigate these failures which break the CI.
15-
// UNSUPPORTED: clang-17, clang-18, clang-19
15+
// UNSUPPORTED: clang-18, clang-19
1616

1717
// The Android libc++ tests are run on a non-Android host, connected to an
1818
// Android device over adb. gdb needs special support to make this work (e.g.

libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
// UNSUPPORTED: c++03, c++11, c++14, c++17
10-
// XFAIL: msvc && clang-17
1110

1211
// class lazy_split_view {
1312
// _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();

libcxx/test/libcxx/ranges/range.adaptors/range.split/no_unique_address.compile.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
// UNSUPPORTED: c++03, c++11, c++14, c++17
10-
// XFAIL: msvc && clang-17
1110

1211
// class split_view {
1312
// _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();

libcxx/test/libcxx/ranges/range.factories/range.istream.view/no_unique_address.compile.pass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
// UNSUPPORTED: no-localization
1010
// UNSUPPORTED: c++03, c++11, c++14, c++17
11-
// XFAIL: msvc && clang-17
1211

1312
// Test the libc++ extension that the value stored in `std::ranges::istream_view` has been marked
1413
// as _LIBCPP_NO_UNIQUE_ADDRESS
@@ -21,4 +20,3 @@ struct Empty {
2120
};
2221

2322
static_assert(sizeof(std::ranges::istream_view<Empty>) == sizeof(void*));
24-

libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Older versions of clang have a bug with atomic builtins affecting double and long double.
1212
// Fixed by 5fdd0948.
13-
// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18)
13+
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
1414

1515
// https://github.com/llvm/llvm-project/issues/72893
1616
// XFAIL: target={{x86_64-.*}} && tsan

libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Older versions of clang have a bug with atomic builtins affecting double and long double.
1212
// Fixed by 5fdd0948.
13-
// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18)
13+
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
1414

1515
// https://github.com/llvm/llvm-project/issues/72893
1616
// XFAIL: target={{x86_64-.*}} && tsan

libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Older versions of clang have a bug with atomic builtins affecting double and long double.
1212
// Fixed by 5fdd0948.
13-
// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18)
13+
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
1414

1515
// floating-point-type operator-=(floating-point-type) volatile noexcept;
1616
// floating-point-type operator-=(floating-point-type) noexcept;

libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Older versions of clang have a bug with atomic builtins affecting double and long double.
1212
// Fixed by 5fdd0948.
13-
// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18)
13+
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
1414

1515
// floating-point-type operator+=(floating-point-type) volatile noexcept;
1616
// floating-point-type operator+=(floating-point-type) noexcept;

libcxx/test/std/containers/views/mdspan/mdspan/index_operator.pass.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,6 @@
3939
#include "../ConvertibleToIntegral.h"
4040
#include "../CustomTestLayouts.h"
4141

42-
// Clang 16 does not support argument packs as input to operator []
43-
#if defined(__clang_major__) && __clang_major__ < 17
44-
template <class MDS>
45-
constexpr auto& access(MDS mds) {
46-
return mds[];
47-
}
48-
template <class MDS>
49-
constexpr auto& access(MDS mds, int64_t i0) {
50-
return mds[i0];
51-
}
52-
template <class MDS>
53-
constexpr auto& access(MDS mds, int64_t i0, int64_t i1) {
54-
return mds[i0, i1];
55-
}
56-
template <class MDS>
57-
constexpr auto& access(MDS mds, int64_t i0, int64_t i1, int64_t i2) {
58-
return mds[i0, i1, i2];
59-
}
60-
template <class MDS>
61-
constexpr auto& access(MDS mds, int64_t i0, int64_t i1, int64_t i2, int64_t i3) {
62-
return mds[i0, i1, i2, i3];
63-
}
64-
#endif
65-
6642
template <class MDS, class... Indices>
6743
concept operator_constraints = requires(MDS m, Indices... idxs) {
6844
{ std::is_same_v<decltype(m[idxs...]), typename MDS::reference> };
@@ -84,11 +60,7 @@ template <class MDS, class... Args>
8460
constexpr void iterate(MDS mds, Args... args) {
8561
constexpr int r = static_cast<int>(MDS::extents_type::rank()) - 1 - static_cast<int>(sizeof...(Args));
8662
if constexpr (-1 == r) {
87-
#if defined(__clang_major__) && __clang_major__ < 17
88-
int* ptr1 = &access(mds, args...);
89-
#else
9063
int* ptr1 = &mds[args...];
91-
#endif
9264
int* ptr2 = &(mds.accessor().access(mds.data_handle(), mds.mapping()(args...)));
9365
assert(ptr1 == ptr2);
9466

libcxx/test/std/experimental/simd/simd.class/simd_copy.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Older versions of clang may encounter a backend error (see 0295c2ad):
1212
// Pass-by-value arguments with alignment greater than register width are not supported.
13-
// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && (clang-17 || clang-18)
13+
// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && clang-18
1414

1515
// <experimental/simd>
1616
//

libcxx/test/std/experimental/simd/simd.class/simd_unary.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Older versions of clang may encounter a backend error (see 0295c2ad):
1212
// Pass-by-value arguments with alignment greater than register width are not supported.
13-
// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && (clang-17 || clang-18)
13+
// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && clang-18
1414

1515
// This test crashes AppleClang 15 but not later versions.
1616
// UNSUPPORTED: apple-clang-15

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// test sized operator delete[] replacement.
1010

1111
// These compiler versions don't enable sized deallocation by default.
12-
// UNSUPPORTED: clang-17, clang-18
12+
// UNSUPPORTED: clang-18
1313

1414
// Android clang-r536225 identifies as clang-19.0 but it predates the real
1515
// LLVM 19.0.0, so it also leaves sized deallocation off by default.

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// Test sized operator delete replacement.
1010

1111
// These compiler versions do not enable sized deallocation by default.
12-
// UNSUPPORTED: clang-17, clang-18
12+
// UNSUPPORTED: clang-18
1313

1414
// Android clang-r536225 identifies as clang-19.0 but it predates the real
1515
// LLVM 19.0.0, so it also leaves sized deallocation off by default.

libcxx/test/std/numerics/c.math/signbit.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// UNSUPPORTED: windows
1313

1414
// These compilers don't support constexpr `__builtin_signbit` yet.
15-
// UNSUPPORTED: clang-17, clang-18, clang-19, apple-clang-15, apple-clang-16
15+
// UNSUPPORTED: clang-18, clang-19, apple-clang-15, apple-clang-16
1616

1717
#include <cassert>
1818
#include <cmath>

libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,10 @@ constexpr bool test() {
121121
}
122122

123123
{
124-
// TODO(LLVM 20): Remove once we drop support for Clang 17
125-
#if defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 1800
126124
// https://github.com/llvm/llvm-project/issues/92676
127125
std::expected<Any, int> e1;
128126
auto e2 = e1;
129127
assert(e2.has_value());
130-
#endif
131128
}
132129

133130
return true;

0 commit comments

Comments
 (0)