Skip to content

Commit 3c33154

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

File tree

34 files changed

+34
-162
lines changed

34 files changed

+34
-162
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
'generic-cxx26',
4949
'generic-modules'
5050
]
51-
cc: [ 'clang-19' ]
52-
cxx: [ 'clang++-19' ]
51+
cc: [ 'clang-20' ]
52+
cxx: [ 'clang++-20' ]
5353
include:
5454
- config: 'generic-gcc'
5555
cc: 'gcc-14'
@@ -88,18 +88,18 @@ jobs:
8888
'generic-cxx20',
8989
'generic-cxx23'
9090
]
91-
cc: [ 'clang-19' ]
92-
cxx: [ 'clang++-19' ]
91+
cc: [ 'clang-20' ]
92+
cxx: [ 'clang++-20' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
9595
cc: 'gcc-14'
9696
cxx: 'g++-14'
9797
- config: 'generic-cxx23'
98-
cc: 'clang-17'
99-
cxx: 'clang++-17'
100-
- config: 'generic-cxx26'
10198
cc: 'clang-18'
10299
cxx: 'clang++-18'
100+
- config: 'generic-cxx26'
101+
cc: 'clang-19'
102+
cxx: 'clang++-19'
103103
steps:
104104
- uses: actions/checkout@v4
105105
- name: ${{ matrix.config }}
@@ -169,8 +169,8 @@ jobs:
169169
- name: ${{ matrix.config }}
170170
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
171171
env:
172-
CC: clang-19
173-
CXX: clang++-19
172+
CC: clang-20
173+
CXX: clang++-20
174174
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
175175
if: always()
176176
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/__cxx03/__memory/uninitialized_algorithms.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,8 @@ __uninitialized_allocator_relocate(_Alloc& __alloc, _Tp* __first, _Tp* __last, _
642642
__guard.__complete();
643643
std::__allocator_destroy(__alloc, __first, __last);
644644
} else {
645-
__builtin_memcpy(const_cast<__remove_const_t<_Tp>*>(__result), __first, sizeof(_Tp) * (__last - __first));
645+
// Casting to void* to suppress clang complaining that this is technically UB.
646+
__builtin_memcpy(static_cast<void*>(__result), __first, sizeof(_Tp) * (__last - __first));
646647
}
647648
}
648649

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
{lit_header_undeprecations.get(header, '')}
3431

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();

0 commit comments

Comments
 (0)