Skip to content

[libc++] Removes unsupported compiler specific code. #134496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -1213,14 +1213,6 @@ typedef __char32_t char32_t;
# define _LIBCPP_DIAGNOSE_NULLPTR
# endif

// TODO(LLVM 22): Remove this macro once LLVM19 support ends. __cpp_explicit_this_parameter has been set in LLVM20.
// Clang-18 has support for deducing this, but it does not set the FTM.
# if defined(__cpp_explicit_this_parameter) || (defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1800)
# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 1
# else
# define _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER 0
# endif

#endif // __cplusplus

#endif // _LIBCPP___CONFIG
12 changes: 6 additions & 6 deletions libcxx/include/__format/format_arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ _LIBCPP_HIDE_FROM_ABI decltype(auto) __visit_format_arg(_Visitor&& __vis, basic_
__libcpp_unreachable();
}

# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# if _LIBCPP_STD_VER >= 26

template <class _Rp, class _Visitor, class _Context>
_LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<_Context> __arg) {
Expand Down Expand Up @@ -200,7 +200,7 @@ _LIBCPP_HIDE_FROM_ABI _Rp __visit_format_arg(_Visitor&& __vis, basic_format_arg<
__libcpp_unreachable();
}

# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# endif // _LIBCPP_STD_VER >= 26

/// Contains the values used in basic_format_arg.
///
Expand Down Expand Up @@ -285,7 +285,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS basic_format_arg {

_LIBCPP_HIDE_FROM_ABI explicit operator bool() const noexcept { return __type_ != __format::__arg_t::__none; }

# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# if _LIBCPP_STD_VER >= 26

// This function is user facing, so it must wrap the non-standard types of
// the "variant" in a handle to stay conforming. See __arg_t for more details.
Expand Down Expand Up @@ -329,7 +329,7 @@ class _LIBCPP_TEMPLATE_VIS _LIBCPP_NO_SPECIALIZATIONS basic_format_arg {
}
}

# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# endif // _LIBCPP_STD_VER >= 26

private:
using char_type = typename _Context::char_type;
Expand Down Expand Up @@ -371,7 +371,7 @@ class _LIBCPP_TEMPLATE_VIS basic_format_arg<_Context>::handle {
// This function is user facing, so it must wrap the non-standard types of
// the "variant" in a handle to stay conforming. See __arg_t for more details.
template <class _Visitor, class _Context>
# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# if _LIBCPP_STD_VER >= 26
_LIBCPP_DEPRECATED_IN_CXX26
# endif
_LIBCPP_HIDE_FROM_ABI decltype(auto)
Expand All @@ -387,7 +387,7 @@ _LIBCPP_DEPRECATED_IN_CXX26
typename __basic_format_arg_value<_Context>::__handle __h{__arg.__value_.__u128_};
return std::invoke(std::forward<_Visitor>(__vis), typename basic_format_arg<_Context>::handle{__h});
}
# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# endif // _LIBCPP_STD_VER >= 26
default:
return std::__visit_format_arg(std::forward<_Visitor>(__vis), __arg);
}
Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/__format/format_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ class _LIBCPP_TEMPLATE_VIS basic_format_context<typename __format::__retarget_bu
__format::__determine_arg_t<basic_format_context, decltype(__arg)>(),
__basic_format_arg_value<basic_format_context>(__arg)};
};
# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# if _LIBCPP_STD_VER >= 26
return static_cast<_Context*>(__c)->arg(__id).visit(std::move(__visitor));
# else
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
return std::visit_format_arg(std::move(__visitor), static_cast<_Context*>(__c)->arg(__id));
_LIBCPP_SUPPRESS_DEPRECATED_POP
# endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# endif // _LIBCPP_STD_VER >= 26
}) {
}

Expand Down
4 changes: 2 additions & 2 deletions libcxx/include/variant
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ public:
__impl_.__swap(__that.__impl_);
}

# if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER
# if _LIBCPP_STD_VER >= 26
// Helper class to implement [variant.visit]/10
// Constraints: The call to visit does not use an explicit template-argument-list
// that begins with a type template-argument.
Expand All @@ -1319,7 +1319,7 @@ public:
_LIBCPP_HIDE_FROM_ABI constexpr _Rp visit(this _Self&& __self, _Visitor&& __visitor) {
return std::visit<_Rp>(std::forward<_Visitor>(__visitor), std::__forward_as<_Self, variant>(__self));
}
# endif
# endif // _LIBCPP_STD_VER >= 26

private:
__variant_detail::__impl<_Types...> __impl_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
// We don't vectorize algorithms on AIX right now.
// XFAIL: target={{.+}}-aix{{.*}}

// We don't vectorize on AppleClang 15 since that apparently breaks std::mismatch
// XFAIL: apple-clang-15

// This test ensures that we enable the vectorization of algorithms on the expected
// platforms.

Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/libcxx/fuzzing/random.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// This test fails because Clang no longer enables -fdelayed-template-parsing
// by default on Windows with C++20 (#69431).
// XFAIL: msvc && (clang-18 || clang-19 || clang-20 || clang-21)
// XFAIL: msvc && (clang-19 || clang-20 || clang-21)

// UNSUPPORTED: c++03, c++11

Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// UNSUPPORTED: c++03

// TODO: Investigate these failures which break the CI.
// UNSUPPORTED: clang-18, clang-19, clang-20, clang-21
// UNSUPPORTED: clang-19, clang-20, clang-21

// 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.
Expand Down
4 changes: 0 additions & 4 deletions libcxx/test/libcxx/memory/shared_ptr_array.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17

// 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll need ADDITIONAL_COMPILE_FLAGS(apple-clang-17): -fsized-deallocation since AppleClang still doesn't enable it by default.

// ADDITIONAL_COMPILE_FLAGS(target=x86_64-w64-windows-gnu): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(target=i686-w64-windows-gnu): -fsized-deallocation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: !has-64-bit-atomics

// Older versions of clang have a bug with atomic builtins affecting double and long double.
// Fixed by 5fdd0948.
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: !has-64-bit-atomics

// Older versions of clang have a bug with atomic builtins affecting double and long double.
// Fixed by 5fdd0948.
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: !has-64-bit-atomics

// Older versions of clang have a bug with atomic builtins affecting double and long double.
// Fixed by 5fdd0948.
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// UNSUPPORTED: c++03, c++11, c++14, c++17
// XFAIL: !has-64-bit-atomics

// Older versions of clang have a bug with atomic builtins affecting double and long double.
// Fixed by 5fdd0948.
// XFAIL: target=powerpc-ibm-{{.*}} && clang-18

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

Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// This test fails because Clang no longer enables -fdelayed-template-parsing
// by default on Windows with C++20 (#69431).
// XFAIL: msvc && (clang-18 || clang-19 || clang-20 || clang-21)
// XFAIL: msvc && (clang-19 || clang-20 || clang-21)

// <math.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

// UNSUPPORTED: c++03, c++11, c++14

// 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-18

// <experimental/simd>
//
// [simd.class]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@

// UNSUPPORTED: c++03, c++11, c++14

// 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-18

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

// FIXME: The following issue occurs on Windows to Armv7 Ubuntu Linux:
// Assertion failed: N->getValueType(0) == MVT::v1i1 && "Expected v1i1 type"
// XFAIL: target=armv7-unknown-linux-gnueabihf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
// UNSUPPORTED: c++03, c++11

// These compiler versions and platforms don't enable sized deallocation by default.
// ADDITIONAL_COMPILE_FLAGS(clang-18): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-15): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-16): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-17): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(target=x86_64-w64-windows-gnu): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(target=i686-w64-windows-gnu): -fsized-deallocation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
// UNSUPPORTED: c++03, c++11

// These compiler versions and platforms don't enable sized deallocation by default.
// ADDITIONAL_COMPILE_FLAGS(clang-18): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-15): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-16): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(apple-clang-17): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(target=x86_64-w64-windows-gnu): -fsized-deallocation
// ADDITIONAL_COMPILE_FLAGS(target=i686-w64-windows-gnu): -fsized-deallocation
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/std/numerics/c.math/cmath.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// This test fails because Clang no longer enables -fdelayed-template-parsing
// by default on Windows with C++20 (#69431).
// XFAIL: msvc && (clang-18 || clang-19 || clang-20 || clang-21)
// XFAIL: msvc && (clang-19 || clang-20 || clang-21)

// <cmath>

Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/std/numerics/c.math/signbit.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// UNSUPPORTED: windows

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

// GCC warns about signbit comparing `bool_v < 0`, which we're testing
// ADDITIONAL_COMPILE_FLAGS(gcc): -Wno-bool-compare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

// REQUIRES: std-at-least-c++26

// The test uses "Placeholder variables with no name"
// UNSUPPORTED: apple-clang-15, apple-clang-16

// <numeric>

// template<class T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

// REQUIRES: std-at-least-c++26

// The test uses "Placeholder variables with no name"
// UNSUPPORTED: apple-clang-15, apple-clang-16

// <numeric>

// template<class T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

// REQUIRES: std-at-least-c++26

// The test uses "Placeholder variables with no name"
// UNSUPPORTED: apple-clang-15, apple-clang-16

// <numeric>

// template<class T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

// REQUIRES: std-at-least-c++26

// The test uses "Placeholder variables with no name"
// UNSUPPORTED: apple-clang-15, apple-clang-16

// <numeric>

// template<class R, class T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

// REQUIRES: std-at-least-c++26

// The test uses "Placeholder variables with no name"
// UNSUPPORTED: apple-clang-15, apple-clang-16

// <numeric>

// template<class T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
// There is a bug in older versions of Clang that causes trouble with constraints in classes like
// `ContainerWithDirectCtr`.
// XFAIL: apple-clang-15

// template<template<class...> class C, input_range R, class... Args>
// constexpr auto to(R&& r, Args&&... args); // Since C++23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,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.
// XFAIL: apple-clang

// <format>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,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.
// XFAIL: apple-clang

// <format>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
// XFAIL: apple-clang

// <format>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "make_string.h"
#include "min_allocator.h"

#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
#if TEST_STD_VER >= 26
TEST_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void test(From value) {
else
assert(false);
};
#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
#if TEST_STD_VER >= 26
format_args.get(0).visit(visitor);
#else
std::visit_format_arg(visitor, format_args.get(0));
Expand All @@ -47,7 +47,7 @@ void test_handle(T value) {
std::basic_format_args<Context> format_args{store};

auto visitor = [](auto a) { assert((std::is_same_v<decltype(a), typename std::basic_format_arg<Context>::handle>)); };
#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
#if TEST_STD_VER >= 26
format_args.get(0).visit(visitor);
#else
std::visit_format_arg(visitor, format_args.get(0));
Expand All @@ -73,7 +73,7 @@ void test_string_view(From value) {
else
assert(false);
};
#if TEST_STD_VER >= 26 && defined(TEST_HAS_EXPLICIT_THIS_PARAMETER)
#if TEST_STD_VER >= 26
format_args.get(0).visit(visitor);
#else
std::visit_format_arg(visitor, format_args.get(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-18, clang-19, gcc-14, apple-clang-16, apple-clang-17
// UNSUPPORTED: clang-19, gcc-14, apple-clang-17

// <type_traits>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-18, clang-19, gcc-14, apple-clang-15, apple-clang-16, apple-clang-17
// UNSUPPORTED: clang-19, gcc-14, apple-clang-17

// <type_traits>

Expand Down
Loading
Loading