From 4a64f35cabec7fcd1a1e23df49e1ad599964e654 Mon Sep 17 00:00:00 2001 From: Robin Caloudis Date: Sun, 15 Sep 2024 18:22:03 +0200 Subject: [PATCH] Remove unrelated changes Let's adjust tests and implementation in a seperate PR. --- libcxx/docs/ReleaseNotes/20.rst | 4 +- libcxx/include/__chrono/weekday.h | 19 +++ libcxx/include/__type_traits/promote.h | 81 +++++++++++ .../diagnose_invalid_memory_order.verify.cpp | 2 +- libcxx/test/libcxx/clang_tidy.gen.py | 3 + .../libcxx/gdb/gdb_pretty_printer_test.sh.cpp | 2 +- .../no_unique_address.compile.pass.cpp | 2 +- .../no_unique_address.compile.pass.cpp | 2 +- .../no_unique_address.compile.pass.cpp | 2 +- .../transform_error.mandates.verify.cpp | 20 +-- .../transform_error.mandates.verify.cpp | 24 ++-- .../atomics.types.float/fetch_add.pass.cpp | 2 +- .../atomics.types.float/fetch_sub.pass.cpp | 2 +- .../operator.minus_equals.pass.cpp | 2 +- .../operator.plus_equals.pass.cpp | 2 +- .../simd/simd.class/simd_copy.pass.cpp | 2 +- .../sized_delete_array14.pass.cpp | 2 +- .../new.delete.single/sized_delete14.pass.cpp | 2 +- .../test/std/numerics/c.math/signbit.pass.cpp | 2 +- .../numeric.ops.sat/add_sat.pass.cpp | 6 +- .../numeric.ops.sat/div_sat.pass.cpp | 6 +- .../numeric.ops.sat/mul_sat.pass.cpp | 6 +- .../numeric.ops.sat/saturate_cast.pass.cpp | 132 +++++++++--------- .../numeric.ops.sat/sub_sat.pass.cpp | 6 +- .../expected.expected/ctor/ctor.copy.pass.cpp | 3 + .../format.arg/visit.pass.cpp | 1 + .../format.arg/visit.return_type.pass.cpp | 1 + .../visit_format_arg.deprecated.verify.cpp | 1 + .../meta/meta.rel/is_virtual_base_of.pass.cpp | 2 +- .../nttp.equivalence.compile.pass.cpp | 1 + .../utility/pairs/pairs.pair/nttp.verify.cpp | 1 + .../robust_against_adl.pass.cpp | 1 + .../variant.visit.member/visit.pass.cpp | 1 + .../visit_return_type.pass.cpp | 1 + 34 files changed, 239 insertions(+), 107 deletions(-) diff --git a/libcxx/docs/ReleaseNotes/20.rst b/libcxx/docs/ReleaseNotes/20.rst index 93bed91992084b3..aecac6692932b87 100644 --- a/libcxx/docs/ReleaseNotes/20.rst +++ b/libcxx/docs/ReleaseNotes/20.rst @@ -64,8 +64,8 @@ Deprecations and Removals removed in language modes prior to C++20. If you are using these features prior to C++20, you will need to update to ``-std=c++20``. -- The relational operators for ``std::chrono::weekday`` are removed entirely, and the - ``_LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS`` macro that was used to re-enable this extension is +- TODO: The relational operators for ``std::chrono::weekday`` will be removed entirely, and the + ``_LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS`` macro that was used to re-enable this extension will be ignored in LLVM 20. - The ``_LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST`` macro no longer has any effect. ``std::allocator`` is not diff --git a/libcxx/include/__chrono/weekday.h b/libcxx/include/__chrono/weekday.h index 728cbb844633fe0..86c780cc718256c 100644 --- a/libcxx/include/__chrono/weekday.h +++ b/libcxx/include/__chrono/weekday.h @@ -79,6 +79,25 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(const weekday& __lhs, con return __lhs.c_encoding() == __rhs.c_encoding(); } +// TODO(LLVM 20): Remove the escape hatch +# ifdef _LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS +_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<(const weekday& __lhs, const weekday& __rhs) noexcept { + return __lhs.c_encoding() < __rhs.c_encoding(); +} + +_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>(const weekday& __lhs, const weekday& __rhs) noexcept { + return __rhs < __lhs; +} + +_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<=(const weekday& __lhs, const weekday& __rhs) noexcept { + return !(__rhs < __lhs); +} + +_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>=(const weekday& __lhs, const weekday& __rhs) noexcept { + return !(__lhs < __rhs); +} +# endif // _LIBCPP_ENABLE_REMOVED_WEEKDAY_RELATIONAL_OPERATORS + _LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator+(const weekday& __lhs, const days& __rhs) noexcept { auto const __mu = static_cast(__lhs.c_encoding()) + __rhs.count(); auto const __yr = (__mu >= 0 ? __mu : __mu - 6) / 7; diff --git a/libcxx/include/__type_traits/promote.h b/libcxx/include/__type_traits/promote.h index cccb6e0e04a00fe..2b2a6843b915021 100644 --- a/libcxx/include/__type_traits/promote.h +++ b/libcxx/include/__type_traits/promote.h @@ -13,12 +13,20 @@ #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 __promote { static_assert((is_arithmetic<_Args>::value && ...)); @@ -42,6 +50,79 @@ class __promote { using type = decltype((__test(_Args()) + ...)); }; +#else + +template +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); +# ifndef _LIBCPP_HAS_NO_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::value; +}; + +template <> +struct __numeric_type { + static const bool value = true; +}; + +template ::value && __numeric_type<_A2>::value && __numeric_type<_A3>::value> +class __promote_imp { +public: + static const bool value = false; +}; + +template +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 __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 __promote_imp<_A1, void, void, true> { +public: + typedef typename __numeric_type<_A1>::type type; + static const bool value = true; +}; + +template +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 diff --git a/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp b/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp index fc83017c7d82277..2790916edaf6987 100644 --- a/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp +++ b/libcxx/test/libcxx/atomics/diagnose_invalid_memory_order.verify.cpp @@ -9,7 +9,7 @@ // 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 +// XFAIL: msvc && clang-17 // REQUIRES: diagnose-if-support diff --git a/libcxx/test/libcxx/clang_tidy.gen.py b/libcxx/test/libcxx/clang_tidy.gen.py index 4311bb49ac802b1..f4f905f579784ff 100644 --- a/libcxx/test/libcxx/clang_tidy.gen.py +++ b/libcxx/test/libcxx/clang_tidy.gen.py @@ -27,6 +27,9 @@ // 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, '')} // TODO: run clang-tidy with modules enabled once they are supported diff --git a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp index 4d0e925ea0fab48..2c8534977febc7e 100644 --- a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp +++ b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp @@ -12,7 +12,7 @@ // UNSUPPORTED: c++03 // TODO: Investigate these failures which break the CI. -// UNSUPPORTED: clang-18, clang-19 +// UNSUPPORTED: clang-17, clang-18, clang-19 // 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. diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp index 33531e2389de0b5..a0bfb7c4a246b5c 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.lazy.split/no_unique_address.compile.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// XFAIL: msvc +// XFAIL: msvc && clang-17 // class lazy_split_view { // _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); diff --git a/libcxx/test/libcxx/ranges/range.adaptors/range.split/no_unique_address.compile.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.split/no_unique_address.compile.pass.cpp index 192b52307e96838..694cf1fd0d0e4ce 100644 --- a/libcxx/test/libcxx/ranges/range.adaptors/range.split/no_unique_address.compile.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.adaptors/range.split/no_unique_address.compile.pass.cpp @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 -// XFAIL: msvc +// XFAIL: msvc && clang-17 // class split_view { // _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); diff --git a/libcxx/test/libcxx/ranges/range.factories/range.istream.view/no_unique_address.compile.pass.cpp b/libcxx/test/libcxx/ranges/range.factories/range.istream.view/no_unique_address.compile.pass.cpp index 64454d81a03803e..a77c4e4d1bcdb00 100644 --- a/libcxx/test/libcxx/ranges/range.factories/range.istream.view/no_unique_address.compile.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.factories/range.istream.view/no_unique_address.compile.pass.cpp @@ -8,7 +8,7 @@ // UNSUPPORTED: no-localization // UNSUPPORTED: c++03, c++11, c++14, c++17 -// XFAIL: msvc +// 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 diff --git a/libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp b/libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp index 5fbc115d670bfc2..61374094b7adfba 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp @@ -6,6 +6,10 @@ // //===----------------------------------------------------------------------===// +// Clang-18 fixed some spurious clang diagnostics. Once clang-18 is the +// minimum required version these obsolete tests can be removed. +// TODO(LLVM-20) remove spurious clang diagnostic tests. + // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // With clang-cl, some warnings have a 'which is a Microsoft extension' suffix @@ -55,12 +59,12 @@ void test() { { std::expected e; e.transform_error(return_unexpected); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} // expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected for {{.*}} is ill-formed.}} // expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}} e.transform_error(return_no_object); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} // expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected for {{.*}} is ill-formed.}} // expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}} } @@ -69,27 +73,27 @@ void test() { { const std::expected e; e.transform_error(return_unexpected); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* 2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} e.transform_error(return_no_object); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* 2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} } // Test && overload { std::expected e; std::move(e).transform_error(return_unexpected); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* 2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} std::move(e).transform_error(return_no_object); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* 2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} } // Test const&& overload { const std::expected e; std::move(e).transform_error(return_unexpected); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* 2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} std::move(e).transform_error(return_no_object); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* 2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-2 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} } } // clang-format on diff --git a/libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp b/libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp index dc553a1fda463f8..16233cd90d2199f 100644 --- a/libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp +++ b/libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp @@ -6,6 +6,10 @@ // //===----------------------------------------------------------------------===// +// Clang-18 fixed some spurious clang diagnostics. Once clang-18 is the +// minumum required version these obsolete tests can be removed. +// TODO(LLVM-20) remove spurious clang diagnostic tests. + // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // With clang-cl, some warnings have a 'which is a Microsoft extension' suffix @@ -56,13 +60,13 @@ void test() { { std::expected e; e.transform_error(return_unexpected); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} // expected-error-re@*:* {{static assertion failed {{.*}}A program that instantiates expected with a E that is not a valid argument for unexpected is ill-formed}} - // expected-error-re@*:* {{call to deleted constructor of {{.*}}}} + // expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}} // expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}} e.transform_error(return_no_object); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} // expected-error-re@*:* {{static assertion failed {{.*}}A program that instantiates expected with a E that is not a valid argument for unexpected is ill-formed}} // expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}} } @@ -71,28 +75,28 @@ void test() { { const std::expected e; e.transform_error(return_unexpected); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} e.transform_error(return_no_object); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} - // expected-error-re@*:* {{call to deleted constructor of {{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}} } // Test && overload { std::expected e; std::move(e).transform_error(return_unexpected); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} std::move(e).transform_error(return_no_object); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} } // Test const&& overload { const std::expected e; std::move(e).transform_error(return_unexpected); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} std::move(e).transform_error(return_no_object); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}} - // expected-error-re@*:* {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} + // expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}} } } // clang-format on diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp index 6c3294bd549b67f..40a475ec38b7230 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_add.pass.cpp @@ -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-18 +// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18) // https://github.com/llvm/llvm-project/issues/72893 // XFAIL: target={{x86_64-.*}} && tsan diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp index 3c9545e32df0497..9e798a2a519ff03 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_sub.pass.cpp @@ -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-18 +// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18) // https://github.com/llvm/llvm-project/issues/72893 // XFAIL: target={{x86_64-.*}} && tsan diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp index f16bf1261656c5d..732bd4d7e5dc2bc 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.minus_equals.pass.cpp @@ -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-18 +// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18) // floating-point-type operator-=(floating-point-type) volatile noexcept; // floating-point-type operator-=(floating-point-type) noexcept; diff --git a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp index 3605648be36da0c..1821aca42c7988e 100644 --- a/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp +++ b/libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.plus_equals.pass.cpp @@ -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-18 +// XFAIL: target=powerpc-ibm-{{.*}} && (clang-17 || clang-18) // floating-point-type operator+=(floating-point-type) volatile noexcept; // floating-point-type operator+=(floating-point-type) noexcept; diff --git a/libcxx/test/std/experimental/simd/simd.class/simd_copy.pass.cpp b/libcxx/test/std/experimental/simd/simd.class/simd_copy.pass.cpp index 722e6f770b05bdb..7d91ca0eada1d36 100644 --- a/libcxx/test/std/experimental/simd/simd.class/simd_copy.pass.cpp +++ b/libcxx/test/std/experimental/simd/simd.class/simd_copy.pass.cpp @@ -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-18 +// XFAIL: target=powerpc{{.*}}-ibm-{{.*}} && (clang-17 || clang-18) // // diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp index e02e522c05c531f..85b641322d99e3d 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp @@ -9,7 +9,7 @@ // test sized operator delete[] replacement. // These compiler versions don't enable sized deallocation by default. -// UNSUPPORTED: clang-18 +// UNSUPPORTED: clang-17, clang-18 // UNSUPPORTED: sanitizer-new-delete, c++03, c++11 // XFAIL: apple-clang diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp index da1fecadee84884..ae614a1432f7dbb 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp @@ -9,7 +9,7 @@ // Test sized operator delete replacement. // These compiler versions do not enable sized deallocation by default. -// UNSUPPORTED: clang-18 +// UNSUPPORTED: clang-17, clang-18 // UNSUPPORTED: sanitizer-new-delete, c++03, c++11 // XFAIL: apple-clang diff --git a/libcxx/test/std/numerics/c.math/signbit.pass.cpp b/libcxx/test/std/numerics/c.math/signbit.pass.cpp index 6dbc0b1413f9dad..a8a566f7de64346 100644 --- a/libcxx/test/std/numerics/c.math/signbit.pass.cpp +++ b/libcxx/test/std/numerics/c.math/signbit.pass.cpp @@ -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 +// UNSUPPORTED: clang-17, clang-18, clang-19, apple-clang-15, apple-clang-16 #include #include diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.pass.cpp index 8288378ab769e14..036bf53e36dcd4f 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/add_sat.pass.cpp @@ -25,7 +25,8 @@ constexpr bool test_signed() { constexpr auto minVal = std::numeric_limits::min(); constexpr auto maxVal = std::numeric_limits::max(); - std::same_as decltype(auto) _ = std::add_sat(minVal, maxVal); + // TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name" + [[maybe_unused]] std::same_as decltype(auto) _ = std::add_sat(minVal, maxVal); static_assert(noexcept(std::add_sat(minVal, maxVal))); @@ -96,7 +97,8 @@ constexpr bool test_unsigned() { constexpr auto minVal = std::numeric_limits::min(); constexpr auto maxVal = std::numeric_limits::max(); - std::same_as decltype(auto) _ = std::add_sat(minVal, maxVal); + // TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name" + [[maybe_unused]] std::same_as decltype(auto) _ = std::add_sat(minVal, maxVal); static_assert(noexcept(std::add_sat(minVal, maxVal))); diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.pass.cpp index fa9841b24d27ac8..b1cace74d882889 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/div_sat.pass.cpp @@ -26,7 +26,8 @@ constexpr bool test_signed() { constexpr auto minVal = std::numeric_limits::min(); constexpr auto maxVal = std::numeric_limits::max(); - std::same_as decltype(auto) _ = std::div_sat(minVal, maxVal); + // TODO(LLVM-20) remove [[maybe_unused]] and `{}` scope since all supported compilers support "Placeholder variables with no name" + [[maybe_unused]] std::same_as decltype(auto) _ = std::div_sat(minVal, maxVal); static_assert(noexcept(std::div_sat(minVal, maxVal))); @@ -88,7 +89,8 @@ constexpr bool test_unsigned() { constexpr auto minVal = std::numeric_limits::min(); constexpr auto maxVal = std::numeric_limits::max(); - std::same_as decltype(auto) _ = std::div_sat(minVal, maxVal); + // TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name" + [[maybe_unused]] std::same_as decltype(auto) _ = std::div_sat(minVal, maxVal); static_assert(noexcept(std::div_sat(minVal, maxVal))); // clang-format off diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.pass.cpp index 060eb52103a024c..2c8eec57e120429 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/mul_sat.pass.cpp @@ -26,7 +26,8 @@ constexpr bool test_signed() { constexpr auto minVal = std::numeric_limits::min(); constexpr auto maxVal = std::numeric_limits::max(); - std::same_as decltype(auto) _ = std::mul_sat(minVal, maxVal); + // TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name" + [[maybe_unused]] std::same_as decltype(auto) _ = std::mul_sat(minVal, maxVal); static_assert(noexcept(std::mul_sat(minVal, maxVal))); @@ -102,7 +103,8 @@ constexpr bool test_unsigned() { constexpr auto minVal = std::numeric_limits::min(); constexpr auto maxVal = std::numeric_limits::max(); - std::same_as decltype(auto) _ = std::mul_sat(minVal, maxVal); + // TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name" + [[maybe_unused]] std::same_as decltype(auto) _ = std::mul_sat(minVal, maxVal); static_assert(noexcept(std::mul_sat(minVal, maxVal))); diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.pass.cpp index 7c3e570c407575b..cbca37e3a661392 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/saturate_cast.pass.cpp @@ -72,312 +72,314 @@ constexpr bool test() { // signed char - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + // TODO(LLVM-20) remove [[maybe_unused]] and `{}` scope since all supported compilers support "Placeholder variables with no name", + // here and below... + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == SCHAR_MIN); assert(std::saturate_cast( O_C) == O_C); assert(std::saturate_cast(SCHAR_MAX) == SCHAR_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == O_C); assert(std::saturate_cast(UCHAR_MAX) == SCHAR_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast(sBigMin) == SCHAR_MIN); // saturated assert(std::saturate_cast( sZero) == O_C); assert(std::saturate_cast(sBigMax) == SCHAR_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == O_C); assert(std::saturate_cast(uBigMax) == SCHAR_MAX); // saturated // short - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == static_cast(SCHAR_MIN)); assert(std::saturate_cast( O_C) == O_S); assert(std::saturate_cast(SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == O_S); assert(std::saturate_cast(UCHAR_MAX) == static_cast(UCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(SHRT_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SHRT_MAX); } assert(std::saturate_cast( SHRT_MIN) == SHRT_MIN); assert(std::saturate_cast( O_S) == O_S); assert(std::saturate_cast( SHRT_MAX) == SHRT_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(USHRT_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(USHRT_MAX); } assert(std::saturate_cast( O_US) == O_S); assert(std::saturate_cast(USHRT_MAX) == SHRT_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == SHRT_MIN); // saturated assert(std::saturate_cast( sZero) == O_S); assert(std::saturate_cast( sBigMax) == SHRT_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == O_S); assert(std::saturate_cast( uBigMax) == SHRT_MAX); // saturated // int - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == static_cast(SCHAR_MIN)); assert(std::saturate_cast( O_C) == 0); assert(std::saturate_cast(SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == 0); assert(std::saturate_cast(UCHAR_MAX) == static_cast(UCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(INT_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(INT_MAX); } assert(std::saturate_cast( INT_MIN) == INT_MIN); assert(std::saturate_cast( 0) == 0); assert(std::saturate_cast( INT_MAX) == INT_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(UINT_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UINT_MAX); } assert(std::saturate_cast( 0) == 0); assert(std::saturate_cast(UINT_MAX) == INT_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == INT_MIN); // saturated assert(std::saturate_cast( sZero) == 0); assert(std::saturate_cast( sBigMax) == INT_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == 0); assert(std::saturate_cast( uBigMax) == INT_MAX); // saturated // long - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == static_cast(SCHAR_MIN)); assert(std::saturate_cast( O_C) == 0L); assert(std::saturate_cast(SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == 0L); assert(std::saturate_cast(UCHAR_MAX) == static_cast(UCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(LONG_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(LONG_MAX); } assert(std::saturate_cast( LONG_MIN) == LONG_MIN); assert(std::saturate_cast( 0L) == 0L); assert(std::saturate_cast( LONG_MAX) == LONG_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(ULONG_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(ULONG_MAX); } assert(std::saturate_cast( 0UL) == 0L); assert(std::saturate_cast(ULONG_MAX) == LONG_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == LONG_MIN); // saturated assert(std::saturate_cast( sZero) == 0L); assert(std::saturate_cast( sBigMax) == LONG_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == 0L); assert(std::saturate_cast( uBigMax) == LONG_MAX); // saturated // long long - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == static_cast(SCHAR_MIN)); assert(std::saturate_cast( 0LL) == 0LL); assert(std::saturate_cast(SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == 0LL); assert(std::saturate_cast(UCHAR_MAX) == static_cast(UCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(LLONG_MIN); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(LLONG_MIN); } assert(std::saturate_cast(LLONG_MIN) == LLONG_MIN); assert(std::saturate_cast( 0LL) == 0LL); assert(std::saturate_cast(LLONG_MAX) == LLONG_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(ULLONG_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(ULLONG_MAX); } assert(std::saturate_cast( 0ULL) == 0LL); assert(std::saturate_cast(ULLONG_MAX) == LLONG_MAX); // saturated #ifndef TEST_HAS_NO_INT128 - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == LLONG_MIN); // (128-bit) saturated assert(std::saturate_cast( sZero) == 0LL); assert(std::saturate_cast( sBigMax) == LLONG_MAX); // (128-bit) saturated - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == 0LL); assert(std::saturate_cast( uBigMax) == LLONG_MAX); // (128-bit) saturated - std::same_as<__int128_t> decltype(auto) _ = std::saturate_cast<__int128_t>(SCHAR_MAX); + { [[maybe_unused]] std::same_as<__int128_t> decltype(auto) _ = std::saturate_cast<__int128_t>(SCHAR_MAX); } assert(std::saturate_cast<__int128_t>(SCHAR_MIN) == static_cast<__int128_t>(SCHAR_MIN)); assert(std::saturate_cast<__int128_t>( O_C) == sZero); assert(std::saturate_cast<__int128_t>(SCHAR_MAX) == static_cast<__int128_t>(SCHAR_MAX)); - std::same_as<__int128_t> decltype(auto) _ = std::saturate_cast<__int128_t>(UCHAR_MAX); + { [[maybe_unused]] std::same_as<__int128_t> decltype(auto) _ = std::saturate_cast<__int128_t>(UCHAR_MAX); } assert(std::saturate_cast<__int128_t>( O_UC) == sZero); assert(std::saturate_cast<__int128_t>(UCHAR_MAX) == static_cast<__int128_t>(UCHAR_MAX)); - std::same_as<__int128_t> decltype(auto) _ = std::saturate_cast<__int128_t>(sBigMax); + { [[maybe_unused]] std::same_as<__int128_t> decltype(auto) _ = std::saturate_cast<__int128_t>(sBigMax); } assert(std::saturate_cast<__int128_t>( sBigMin) == sBigMin); assert(std::saturate_cast<__int128_t>( sZero) == sZero); assert(std::saturate_cast<__int128_t>( sBigMax) == sBigMax); - std::same_as<__int128_t> decltype(auto) _ = std::saturate_cast<__int128_t>(uBigMax); + { [[maybe_unused]] std::same_as<__int128_t> decltype(auto) _ = std::saturate_cast<__int128_t>(uBigMax); } assert(std::saturate_cast<__int128_t>( uZero) == sZero); assert(std::saturate_cast<__int128_t>( uBigMax) == sBigMax); // saturated #endif // unsigned char - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == O_UC); assert(std::saturate_cast( O_C) == O_UC); assert(std::saturate_cast(SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == O_UC); assert(std::saturate_cast(UCHAR_MAX) == UCHAR_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == O_UC); // saturated assert(std::saturate_cast( sZero) == O_UC); assert(std::saturate_cast( sBigMax) == UCHAR_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == O_UC); assert(std::saturate_cast( uBigMax) == UCHAR_MAX); // saturated // unsigned short - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == O_US); assert(std::saturate_cast( O_C) == O_US); assert(std::saturate_cast(SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == O_US); assert(std::saturate_cast(UCHAR_MAX) == static_cast(UCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MIN); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MIN); } assert(std::saturate_cast( SHRT_MIN) == O_US); assert(std::saturate_cast( O_S) == O_US); assert(std::saturate_cast( SHRT_MAX) == static_cast(SHRT_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_US) == O_US); assert(std::saturate_cast(USHRT_MAX) == USHRT_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == O_US); // saturated assert(std::saturate_cast( sZero) == O_US); assert(std::saturate_cast( sBigMax) == USHRT_MAX); // saturated - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == O_US); assert(std::saturate_cast( uBigMax) == USHRT_MAX); // saturated // unsigned int - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == O_US); assert(std::saturate_cast( O_UC) == 0U); assert(std::saturate_cast(SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == 0U); assert(std::saturate_cast(UCHAR_MAX) == static_cast(UCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(INT_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(INT_MAX); } assert(std::saturate_cast( INT_MIN) == 0U); assert(std::saturate_cast( 0) == 0U); assert(std::saturate_cast( INT_MAX) == static_cast(INT_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UINT_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UINT_MAX); } assert(std::saturate_cast( 0U) == 0U); assert(std::saturate_cast( UINT_MAX) == UINT_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == 0U); // saturated assert(std::saturate_cast( sZero) == 0U); assert(std::saturate_cast( sBigMax) == UINT_MAX); // saturated - - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == 0U); assert(std::saturate_cast( uBigMax) == UINT_MAX); // saturated // unsigned long - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast(SCHAR_MIN) == 0UL); assert(std::saturate_cast( O_C) == 0UL); assert(std::saturate_cast(SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == 0UL); assert(std::saturate_cast(UCHAR_MAX) == static_cast(UCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(LONG_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(LONG_MAX); } assert(std::saturate_cast( LONG_MIN) == 0UL); assert(std::saturate_cast( 0L) == 0UL); assert(std::saturate_cast( LONG_MAX) == static_cast(LONG_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(ULONG_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(ULONG_MAX); } assert(std::saturate_cast( 0UL) == 0UL); assert(std::saturate_cast(ULONG_MAX) == ULONG_MAX); - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == 0UL); // saturated assert(std::saturate_cast( sZero) == 0UL); assert(std::saturate_cast( sBigMax) == (sizeof(UIntT) > sizeof(unsigned long int) ? ULONG_MAX : LONG_MAX)); // saturated depending on underlying types - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == 0UL); assert(std::saturate_cast( uBigMax) == ULONG_MAX); // saturated // unsigned long long - std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(SCHAR_MAX); } assert(std::saturate_cast( SCHAR_MIN) == 0ULL); assert(std::saturate_cast( O_C) == 0ULL); assert(std::saturate_cast( SCHAR_MAX) == static_cast(SCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(UCHAR_MAX); } assert(std::saturate_cast( O_UC) == 0ULL); assert(std::saturate_cast( UCHAR_MAX) == static_cast(UCHAR_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(LLONG_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(LLONG_MAX); } assert(std::saturate_cast( LLONG_MIN) == 0ULL); assert(std::saturate_cast( 0LL) == 0ULL); assert(std::saturate_cast( LLONG_MAX) == static_cast(LLONG_MAX)); - std::same_as decltype(auto) _ = std::saturate_cast(ULLONG_MAX); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(ULLONG_MAX); } assert(std::saturate_cast( 0ULL) == 0ULL); assert(std::saturate_cast(ULLONG_MAX) == ULLONG_MAX); #ifndef TEST_HAS_NO_INT128 - std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(sBigMax); } assert(std::saturate_cast( sBigMin) == 0ULL); // (128-bit) saturated assert(std::saturate_cast( sZero) == 0ULL); assert(std::saturate_cast( sBigMax) == ULLONG_MAX); // (128-bit) saturated - std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); + { [[maybe_unused]] std::same_as decltype(auto) _ = std::saturate_cast(uBigMax); } assert(std::saturate_cast( uZero) == 0ULL); assert(std::saturate_cast( uBigMax) == ULLONG_MAX); // (128-bit) saturated - std::same_as<__uint128_t> decltype(auto) _ = std::saturate_cast<__uint128_t>(SCHAR_MIN); + { [[maybe_unused]] std::same_as<__uint128_t> decltype(auto) _ = std::saturate_cast<__uint128_t>(SCHAR_MIN); } assert(std::saturate_cast<__uint128_t>(SCHAR_MIN) == uZero); assert(std::saturate_cast<__uint128_t>( O_C) == uZero); assert(std::saturate_cast<__uint128_t>(SCHAR_MAX) == static_cast<__uint128_t>(SCHAR_MAX)); - std::same_as<__uint128_t> decltype(auto) _ = std::saturate_cast<__uint128_t>(UCHAR_MAX); + { [[maybe_unused]] std::same_as<__uint128_t> decltype(auto) _ = std::saturate_cast<__uint128_t>(UCHAR_MAX); } assert(std::saturate_cast<__uint128_t>( O_UC) == uZero); assert(std::saturate_cast<__uint128_t>(UCHAR_MAX) == static_cast<__uint128_t>(UCHAR_MAX)); - std::same_as<__uint128_t> decltype(auto) _ = std::saturate_cast<__uint128_t>(sBigMax); + { [[maybe_unused]] std::same_as<__uint128_t> decltype(auto) _ = std::saturate_cast<__uint128_t>(sBigMax); } assert(std::saturate_cast<__uint128_t>( sBigMin) == uZero); // saturated assert(std::saturate_cast<__uint128_t>( sZero) == uZero); assert(std::saturate_cast<__uint128_t>( sBigMax) == static_cast<__uint128_t>(sBigMax)); - std::same_as<__uint128_t> decltype(auto) _ = std::saturate_cast<__uint128_t>(uBigMax); + { [[maybe_unused]] std::same_as<__uint128_t> decltype(auto) _ = std::saturate_cast<__uint128_t>(uBigMax); } assert(std::saturate_cast<__uint128_t>( uZero) == uZero); assert(std::saturate_cast<__uint128_t>( uBigMax) == uBigMax); #endif diff --git a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.pass.cpp b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.pass.cpp index fe4255c1f7a6b88..d7bdf2c0271acf3 100644 --- a/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.pass.cpp +++ b/libcxx/test/std/numerics/numeric.ops/numeric.ops.sat/sub_sat.pass.cpp @@ -26,7 +26,8 @@ constexpr bool test_signed() { constexpr auto minVal = std::numeric_limits::min(); constexpr auto maxVal = std::numeric_limits::max(); - std::same_as decltype(auto) _ = std::sub_sat(minVal, maxVal); + // TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name" + [[maybe_unused]] std::same_as decltype(auto) _ = std::sub_sat(minVal, maxVal); static_assert(noexcept(std::sub_sat(minVal, maxVal))); @@ -88,7 +89,8 @@ constexpr bool test_unsigned() { constexpr auto minVal = std::numeric_limits::min(); constexpr auto maxVal = std::numeric_limits::max(); - std::same_as decltype(auto) _ = std::sub_sat(minVal, maxVal); + // TODO(LLVM-20) remove [[maybe_unused]] since all supported compilers support "Placeholder variables with no name" + [[maybe_unused]] std::same_as decltype(auto) _ = std::sub_sat(minVal, maxVal); static_assert(noexcept(std::sub_sat(minVal, maxVal))); diff --git a/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp b/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp index 32560bf8fac35b5..9e78596929fb62c 100644 --- a/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp +++ b/libcxx/test/std/utilities/expected/expected.expected/ctor/ctor.copy.pass.cpp @@ -121,10 +121,13 @@ constexpr bool test() { } { + // TODO(LLVM 20): Remove once we drop support for Clang 17 +#if defined(TEST_CLANG_VER) && TEST_CLANG_VER >= 1800 // https://github.com/llvm/llvm-project/issues/92676 std::expected e1; auto e2 = e1; assert(e2.has_value()); +#endif } return true; diff --git a/libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp index 20e0a5ed66bd054..829b74121b9c6b8 100644 --- a/libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.arg/visit.pass.cpp @@ -9,6 +9,7 @@ // 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 // diff --git a/libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp index 8a79dd4d50f20d4..874d609432f221f 100644 --- a/libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp @@ -9,6 +9,7 @@ // 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 // diff --git a/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp b/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp index 146ceba58872e23..e3e3e9a19e122f9 100644 --- a/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp +++ b/libcxx/test/std/utilities/format/format.arguments/format.arg/visit_format_arg.deprecated.verify.cpp @@ -8,6 +8,7 @@ // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23 // UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME +// UNSUPPORTED: clang-17 // XFAIL: apple-clang // diff --git a/libcxx/test/std/utilities/meta/meta.rel/is_virtual_base_of.pass.cpp b/libcxx/test/std/utilities/meta/meta.rel/is_virtual_base_of.pass.cpp index f443d2030961d1c..6b34d56e2c6f453 100644 --- a/libcxx/test/std/utilities/meta/meta.rel/is_virtual_base_of.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.rel/is_virtual_base_of.pass.cpp @@ -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-17, clang-18, clang-19, gcc-14, apple-clang-16, apple-clang-17 // diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.pair/nttp.equivalence.compile.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.pair/nttp.equivalence.compile.pass.cpp index f5fd5a674882bd8..db45a56feb88aa4 100644 --- a/libcxx/test/std/utilities/utility/pairs/pairs.pair/nttp.equivalence.compile.pass.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pairs.pair/nttp.equivalence.compile.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-17 // diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.pair/nttp.verify.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.pair/nttp.verify.cpp index 499ba6b243bed42..ac081495a62052d 100644 --- a/libcxx/test/std/utilities/utility/pairs/pairs.pair/nttp.verify.cpp +++ b/libcxx/test/std/utilities/utility/pairs/pairs.pair/nttp.verify.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-17 // diff --git a/libcxx/test/std/utilities/variant/variant.visit.member/robust_against_adl.pass.cpp b/libcxx/test/std/utilities/variant/variant.visit.member/robust_against_adl.pass.cpp index 8a8d41547fbec16..bea6d949924bd8b 100644 --- a/libcxx/test/std/utilities/variant/variant.visit.member/robust_against_adl.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.visit.member/robust_against_adl.pass.cpp @@ -8,6 +8,7 @@ // 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 // diff --git a/libcxx/test/std/utilities/variant/variant.visit.member/visit.pass.cpp b/libcxx/test/std/utilities/variant/variant.visit.member/visit.pass.cpp index f68112d30fc35df..0da23fd58ccaa70 100644 --- a/libcxx/test/std/utilities/variant/variant.visit.member/visit.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.visit.member/visit.pass.cpp @@ -8,6 +8,7 @@ // 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 // diff --git a/libcxx/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp b/libcxx/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp index 8093af0aba587ca..7429cdf80facaa2 100644 --- a/libcxx/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp @@ -8,6 +8,7 @@ // 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 //