[libc++] Update the CI to Clang-20 and drop Clang-17 support (#117429)

This commit is contained in:
Nikolas Klauser
2025-01-28 12:35:33 +01:00
committed by GitHub
parent 75aa5a3556
commit 7f845cba2c
34 changed files with 38 additions and 138 deletions

View File

@@ -48,8 +48,8 @@ jobs:
'generic-cxx26',
'generic-modules'
]
cc: [ 'clang-19' ]
cxx: [ 'clang++-19' ]
cc: [ 'clang-20' ]
cxx: [ 'clang++-20' ]
include:
- config: 'generic-gcc'
cc: 'gcc-14'
@@ -88,18 +88,18 @@ jobs:
'generic-cxx20',
'generic-cxx23'
]
cc: [ 'clang-19' ]
cxx: [ 'clang++-19' ]
cc: [ 'clang-20' ]
cxx: [ 'clang++-20' ]
include:
- config: 'generic-gcc-cxx11'
cc: 'gcc-14'
cxx: 'g++-14'
- config: 'generic-cxx23'
cc: 'clang-17'
cxx: 'clang++-17'
- config: 'generic-cxx26'
cc: 'clang-18'
cxx: 'clang++-18'
- config: 'generic-cxx26'
cc: 'clang-19'
cxx: 'clang++-19'
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.config }}
@@ -169,8 +169,8 @@ jobs:
- name: ${{ matrix.config }}
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
env:
CC: clang-19
CXX: clang++-19
CC: clang-20
CXX: clang++-20
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: always()
with:

View File

@@ -33,8 +33,8 @@
// Warn if a compiler version is used that is not supported anymore
// LLVM RELEASE Update the minimum compiler versions
# if defined(_LIBCPP_CLANG_VER)
# if _LIBCPP_CLANG_VER < 1700
# warning "Libc++ only supports Clang 17 and later"
# if _LIBCPP_CLANG_VER < 1800
# warning "Libc++ only supports Clang 18 and later"
# endif
# elif defined(_LIBCPP_APPLE_CLANG_VER)
# if _LIBCPP_APPLE_CLANG_VER < 1500

View File

@@ -642,7 +642,8 @@ __uninitialized_allocator_relocate(_Alloc& __alloc, _Tp* __first, _Tp* __last, _
__guard.__complete();
std::__allocator_destroy(__alloc, __first, __last);
} else {
__builtin_memcpy(const_cast<__remove_const_t<_Tp>*>(__result), __first, sizeof(_Tp) * (__last - __first));
// Casting to void* to suppress clang complaining that this is technically UB.
__builtin_memcpy(static_cast<void*>(__result), __first, sizeof(_Tp) * (__last - __first));
}
}

View File

@@ -13,20 +13,12 @@
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_arithmetic.h>
#if defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER == 1700
# include <__type_traits/is_same.h>
# include <__utility/declval.h>
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_BEGIN_NAMESPACE_STD
// TODO(LLVM-20): Remove this workaround
#if !defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER != 1700
template <class... _Args>
class __promote {
static_assert((is_arithmetic<_Args>::value && ...));
@@ -39,10 +31,10 @@ class __promote {
static double __test(unsigned long);
static double __test(long long);
static double __test(unsigned long long);
# if _LIBCPP_HAS_INT128
#if _LIBCPP_HAS_INT128
static double __test(__int128_t);
static double __test(__uint128_t);
# endif
#endif
static double __test(double);
static long double __test(long double);
@@ -50,79 +42,6 @@ public:
using type = decltype((__test(_Args()) + ...));
};
#else
template <class _Tp>
struct __numeric_type {
static void __test(...);
static float __test(float);
static double __test(char);
static double __test(int);
static double __test(unsigned);
static double __test(long);
static double __test(unsigned long);
static double __test(long long);
static double __test(unsigned long long);
# if _LIBCPP_HAS_INT128
static double __test(__int128_t);
static double __test(__uint128_t);
# endif
static double __test(double);
static long double __test(long double);
typedef decltype(__test(std::declval<_Tp>())) type;
static const bool value = _IsNotSame<type, void>::value;
};
template <>
struct __numeric_type<void> {
static const bool value = true;
};
template <class _A1,
class _A2 = void,
class _A3 = void,
bool = __numeric_type<_A1>::value && __numeric_type<_A2>::value && __numeric_type<_A3>::value>
class __promote_imp {
public:
static const bool value = false;
};
template <class _A1, class _A2, class _A3>
class __promote_imp<_A1, _A2, _A3, true> {
private:
typedef typename __promote_imp<_A1>::type __type1;
typedef typename __promote_imp<_A2>::type __type2;
typedef typename __promote_imp<_A3>::type __type3;
public:
typedef decltype(__type1() + __type2() + __type3()) type;
static const bool value = true;
};
template <class _A1, class _A2>
class __promote_imp<_A1, _A2, void, true> {
private:
typedef typename __promote_imp<_A1>::type __type1;
typedef typename __promote_imp<_A2>::type __type2;
public:
typedef decltype(__type1() + __type2()) type;
static const bool value = true;
};
template <class _A1>
class __promote_imp<_A1, void, void, true> {
public:
typedef typename __numeric_type<_A1>::type type;
static const bool value = true;
};
template <class _A1, class _A2 = void, class _A3 = void>
class __promote : public __promote_imp<_A1, _A2, _A3> {};
#endif // !defined(_LIBCPP_CLANG_VER) || _LIBCPP_CLANG_VER >= 1700
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___TYPE_TRAITS_PROMOTE_H

View File

@@ -199,7 +199,7 @@ __format(const __tz::__continuation& __continuation, const string& __letters, se
// active at the end. This should be determined separately.
return chrono::seconds{0};
else
static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support
static_assert(false);
std::__libcpp_unreachable();
},
@@ -225,7 +225,7 @@ __format(const __tz::__continuation& __continuation, const string& __letters, se
else if constexpr (same_as<_Tp, __tz::__constrained_weekday>)
return __value(__year, __month);
else
static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support
static_assert(false);
std::__libcpp_unreachable();
},
@@ -688,7 +688,7 @@ __get_sys_info(sys_seconds __time,
else if constexpr (same_as<_Tp, __tz::__save>)
return chrono::__get_sys_info_basic(__time, __continuation_begin, __continuation, __value.__time);
else
static_assert(sizeof(_Tp) == 0); // TODO TZDB static_assert(false); after droping clang-16 support
static_assert(false);
std::__libcpp_unreachable();
},

View File

@@ -6,11 +6,6 @@
//
//===----------------------------------------------------------------------===//
// This test fails with Clang <18 because diagnose_if doesn't emit all of the
// diagnostics when -fdelayed-template-parsing is enabled, like it is in MSVC
// mode.
// XFAIL: msvc && clang-17
// REQUIRES: diagnose-if-support
// <atomic>

View File

@@ -26,9 +26,6 @@ for header in public_headers:
// The GCC compiler flags are not always compatible with clang-tidy.
// UNSUPPORTED: gcc
// Clang 17 has false positives.
// UNSUPPORTED: clang-17
{lit_header_restrictions.get(header, '')}
{lit_header_undeprecations.get(header, '')}

View File

@@ -12,7 +12,7 @@
// UNSUPPORTED: c++03
// TODO: Investigate these failures which break the CI.
// UNSUPPORTED: clang-17, clang-18, clang-19
// UNSUPPORTED: clang-18, clang-19, clang-20
// The Android libc++ tests are run on a non-Android host, connected to an
// Android device over adb. gdb needs special support to make this work (e.g.

View File

@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: msvc && clang-17
// class lazy_split_view {
// _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();

View File

@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: msvc && clang-17
// class split_view {
// _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View();

View File

@@ -8,7 +8,6 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: msvc && clang-17
// Test the libc++ extension that the value stored in `std::ranges::istream_view` has been marked
// as _LIBCPP_NO_UNIQUE_ADDRESS
@@ -21,4 +20,3 @@ struct Empty {
};
static_assert(sizeof(std::ranges::istream_view<Empty>) == sizeof(void*));

View File

@@ -10,7 +10,7 @@
// Older versions of clang have a bug with atomic builtins affecting double and long double.
// Fixed by 5fdd0948.
// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18)
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
// https://github.com/llvm/llvm-project/issues/72893
// XFAIL: target={{x86_64-.*}} && tsan

View File

@@ -10,7 +10,7 @@
// Older versions of clang have a bug with atomic builtins affecting double and long double.
// Fixed by 5fdd0948.
// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18)
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
// https://github.com/llvm/llvm-project/issues/72893
// XFAIL: target={{x86_64-.*}} && tsan

View File

@@ -10,7 +10,7 @@
// Older versions of clang have a bug with atomic builtins affecting double and long double.
// Fixed by 5fdd0948.
// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18)
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
// floating-point-type operator-=(floating-point-type) volatile noexcept;
// floating-point-type operator-=(floating-point-type) noexcept;

View File

@@ -10,7 +10,7 @@
// Older versions of clang have a bug with atomic builtins affecting double and long double.
// Fixed by 5fdd0948.
// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18)
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18
// floating-point-type operator+=(floating-point-type) volatile noexcept;
// floating-point-type operator+=(floating-point-type) noexcept;

View File

@@ -39,8 +39,8 @@
#include "../ConvertibleToIntegral.h"
#include "../CustomTestLayouts.h"
// Clang 16 does not support argument packs as input to operator []
#if defined(__clang_major__) && __clang_major__ < 17
// Apple Clang does not support argument packs as input to operator []
#ifdef TEST_COMPILER_APPLE_CLANG
template <class MDS>
constexpr auto& access(MDS mds) {
return mds[];
@@ -84,7 +84,7 @@ template <class MDS, class... Args>
constexpr void iterate(MDS mds, Args... args) {
constexpr int r = static_cast<int>(MDS::extents_type::rank()) - 1 - static_cast<int>(sizeof...(Args));
if constexpr (-1 == r) {
#if defined(__clang_major__) && __clang_major__ < 17
#ifdef TEST_COMPILER_APPLE_CLANG
int* ptr1 = &access(mds, args...);
#else
int* ptr1 = &mds[args...];

View File

@@ -93,7 +93,9 @@ constexpr bool testSpan()
assert(s3.data() == val && s3.size() == 2);
assert(s4.data() == val && s4.size() == 2);
std::span<const int> s5 = {{1,2}};
TEST_DIAGNOSTIC_PUSH
TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdangling")
std::span<const int> s5 = {{1, 2}};
#if TEST_STD_VER >= 26
std::span<const int, 2> s6({1, 2});
#else
@@ -101,6 +103,7 @@ constexpr bool testSpan()
#endif
assert(s5.size() == 2); // and it dangles
assert(s6.size() == 2); // and it dangles
TEST_DIAGNOSTIC_POP
return true;
}

View File

@@ -10,7 +10,7 @@
// Older versions of clang may encounter a backend error (see 0295c2ad):
// Pass-by-value arguments with alignment greater than register width are not supported.
// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && (clang-17 || clang-18)
// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && clang-18
// <experimental/simd>
//

View File

@@ -10,7 +10,7 @@
// Older versions of clang may encounter a backend error (see 0295c2ad):
// Pass-by-value arguments with alignment greater than register width are not supported.
// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && (clang-17 || clang-18)
// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && clang-18
// This test crashes AppleClang 15 but not later versions.
// UNSUPPORTED: apple-clang-15

View File

@@ -11,7 +11,6 @@
// UNSUPPORTED: c++03, c++11
// These compiler versions and platforms don't enable sized deallocation by default.
// ADDITIONAL_COMPILE_FLAGS(clang-17): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(clang-18): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-15): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-16): -fsized-deallocation

View File

@@ -11,7 +11,6 @@
// UNSUPPORTED: c++03, c++11
// These compiler versions and platforms don't enable sized deallocation by default.
// ADDITIONAL_COMPILE_FLAGS(clang-17): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(clang-18): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-15): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-16): -fsized-deallocation

View File

@@ -12,7 +12,7 @@
// UNSUPPORTED: windows
// These compilers don't support constexpr `__builtin_signbit` yet.
// UNSUPPORTED: clang-17, clang-18, clang-19, apple-clang-15, apple-clang-16
// UNSUPPORTED: clang-18, clang-19, apple-clang-15, apple-clang-16
// XFAIL: FROZEN-CXX03-HEADERS-FIXME

View File

@@ -121,8 +121,8 @@ constexpr bool test() {
}
{
// TODO(LLVM 20): Remove once we drop support for Clang 17
#if defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 1800
// TODO: Drop this once AppleClang is upgraded
#ifndef TEST_COMPILER_APPLE_CLANG
// https://github.com/llvm/llvm-project/issues/92676
std::expected<Any, int> e1;
auto e2 = e1;

View File

@@ -9,7 +9,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
// The tested functionality needs deducing this.
// UNSUPPORTED: clang-17
// XFAIL: apple-clang
// <format>

View File

@@ -9,7 +9,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
// The tested functionality needs deducing this.
// UNSUPPORTED: clang-17
// XFAIL: apple-clang
// <format>

View File

@@ -8,7 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
// UNSUPPORTED: clang-17
// XFAIL: apple-clang
// <format>

View File

@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
// These compilers don't support __builtin_is_virtual_base_of yet.
// UNSUPPORTED: clang-17, clang-18, clang-19, gcc-14, apple-clang-16, apple-clang-17
// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-16
// <type_traits>

View File

@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// These compilers don't support __builtin_is_implicit_lifetime yet.
// UNSUPPORTED: clang-17, clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16
// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16
// <type_traits>

View File

@@ -9,7 +9,7 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// These compilers don't support __builtin_is_implicit_lifetime yet.
// UNSUPPORTED: clang-17, clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16
// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-15, apple-clang-16
// <type_traits>

View File

@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-17
// <utility>

View File

@@ -7,7 +7,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-17
// <utility>

View File

@@ -7,8 +7,6 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
// The tested functionality needs deducing this.
// UNSUPPORTED: clang-17
// XFAIL: apple-clang
// <variant>

View File

@@ -8,7 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
// The tested functionality needs deducing this.
// UNSUPPORTED: clang-17
// XFAIL: apple-clang
// <variant>

View File

@@ -8,7 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
// The tested functionality needs deducing this.
// UNSUPPORTED: clang-17
// XFAIL: apple-clang
// <variant>