mirror of
https://github.com/bolucat/Archive.git
synced 2025-10-05 08:08:03 +08:00
168 lines
7.1 KiB
Diff
168 lines
7.1 KiB
Diff
From 93dc957bd07760c5d810785707bf6bea2b18676e Mon Sep 17 00:00:00 2001
|
|
From: Nikolas Klauser <nikolasklauser@berlin.de>
|
|
Date: Sat, 1 Jun 2024 12:20:41 +0200
|
|
Subject: [PATCH] [libc++] Fix failures with GCC 14 (#92663)
|
|
|
|
Fixes #91831
|
|
|
|
NOKEYCHECK=True
|
|
GitOrigin-RevId: cb7a03b41fff563c0cbb5145eed09f9b17edf9e2
|
|
---
|
|
include/__string/constexpr_c_functions.h | 2 +-
|
|
include/__type_traits/remove_pointer.h | 5 +++++
|
|
include/bitset | 3 +++
|
|
.../time.zone/time.zone.leap/nonmembers/comparison.pass.cpp | 4 ++--
|
|
.../expected/expected.expected/monadic/transform.pass.cpp | 2 +-
|
|
.../expected.expected/monadic/transform_error.pass.cpp | 2 +-
|
|
.../expected/expected.void/monadic/transform_error.pass.cpp | 2 +-
|
|
.../format.formatter.spec/formatter.char_array.pass.cpp | 2 +-
|
|
.../utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp | 3 +++
|
|
.../variant/variant.visit.member/visit_return_type.pass.cpp | 3 +++
|
|
10 files changed, 21 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/include/__string/constexpr_c_functions.h b/include/__string/constexpr_c_functions.h
|
|
index 4da8542e3..a978f816f 100644
|
|
--- a/include/__string/constexpr_c_functions.h
|
|
+++ b/include/__string/constexpr_c_functions.h
|
|
@@ -123,7 +123,7 @@ __constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n
|
|
}
|
|
return true;
|
|
} else {
|
|
- return __builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0;
|
|
+ return ::__builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0;
|
|
}
|
|
}
|
|
|
|
diff --git a/include/__type_traits/remove_pointer.h b/include/__type_traits/remove_pointer.h
|
|
index 54390a193..1048f6705 100644
|
|
--- a/include/__type_traits/remove_pointer.h
|
|
+++ b/include/__type_traits/remove_pointer.h
|
|
@@ -23,8 +23,13 @@ struct remove_pointer {
|
|
using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
|
|
};
|
|
|
|
+# ifdef _LIBCPP_COMPILER_GCC
|
|
+template <class _Tp>
|
|
+using __remove_pointer_t = typename remove_pointer<_Tp>::type;
|
|
+# else
|
|
template <class _Tp>
|
|
using __remove_pointer_t = __remove_pointer(_Tp);
|
|
+# endif
|
|
#else
|
|
// clang-format off
|
|
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;};
|
|
diff --git a/include/bitset b/include/bitset
|
|
index 8818ab656..6bd7bfe58 100644
|
|
--- a/include/bitset
|
|
+++ b/include/bitset
|
|
@@ -375,8 +375,11 @@ template <size_t _N_words, size_t _Size>
|
|
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long
|
|
__bitset<_N_words, _Size>::to_ullong(true_type, true_type) const {
|
|
unsigned long long __r = __first_[0];
|
|
+ _LIBCPP_DIAGNOSTIC_PUSH
|
|
+ _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshift-count-overflow")
|
|
for (size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
|
|
__r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);
|
|
+ _LIBCPP_DIAGNOSTIC_POP
|
|
return __r;
|
|
}
|
|
|
|
diff --git a/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp b/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp
|
|
index 448cd88d1..ccff0248e 100644
|
|
--- a/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp
|
|
+++ b/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp
|
|
@@ -9,8 +9,8 @@
|
|
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
|
// UNSUPPORTED: no-filesystem, no-localization, no-tzdb
|
|
|
|
-// TODO TZDB test whether this can be enabled with gcc 14.
|
|
-// UNSUPPORTED: gcc-13
|
|
+// TODO TZDB investigate why this fails with GCC
|
|
+// UNSUPPORTED: gcc-13, gcc-14
|
|
|
|
// XFAIL: libcpp-has-no-experimental-tzdb
|
|
// XFAIL: availability-tzdb-missing
|
|
diff --git a/test/std/utilities/expected/expected.expected/monadic/transform.pass.cpp b/test/std/utilities/expected/expected.expected/monadic/transform.pass.cpp
|
|
index d38a46f04..aa7106fb9 100644
|
|
--- a/test/std/utilities/expected/expected.expected/monadic/transform.pass.cpp
|
|
+++ b/test/std/utilities/expected/expected.expected/monadic/transform.pass.cpp
|
|
@@ -10,7 +10,7 @@
|
|
|
|
// GCC has a issue for `Guaranteed copy elision for potentially-overlapping non-static data members`,
|
|
// please refer to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108333
|
|
-// XFAIL: gcc-13
|
|
+// XFAIL: gcc-13, gcc-14
|
|
|
|
// <expected>
|
|
|
|
diff --git a/test/std/utilities/expected/expected.expected/monadic/transform_error.pass.cpp b/test/std/utilities/expected/expected.expected/monadic/transform_error.pass.cpp
|
|
index ec55f637f..ae9feccb5 100644
|
|
--- a/test/std/utilities/expected/expected.expected/monadic/transform_error.pass.cpp
|
|
+++ b/test/std/utilities/expected/expected.expected/monadic/transform_error.pass.cpp
|
|
@@ -10,7 +10,7 @@
|
|
|
|
// GCC has a issue for `Guaranteed copy elision for potentially-overlapping non-static data members`,
|
|
// please refer to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108333.
|
|
-// XFAIL: gcc-13
|
|
+// XFAIL: gcc-13, gcc-14
|
|
|
|
// <expected>
|
|
|
|
diff --git a/test/std/utilities/expected/expected.void/monadic/transform_error.pass.cpp b/test/std/utilities/expected/expected.void/monadic/transform_error.pass.cpp
|
|
index cd6e5a503..f70bddbed 100644
|
|
--- a/test/std/utilities/expected/expected.void/monadic/transform_error.pass.cpp
|
|
+++ b/test/std/utilities/expected/expected.void/monadic/transform_error.pass.cpp
|
|
@@ -10,7 +10,7 @@
|
|
|
|
// GCC has a issue for `Guaranteed copy elision for potentially-overlapping non-static data members`,
|
|
// please refer to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108333
|
|
-// XFAIL: gcc-13
|
|
+// XFAIL: gcc-13, gcc-14
|
|
|
|
// <expected>
|
|
|
|
diff --git a/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp b/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
|
|
index b0ee399a1..cad13c1ef 100644
|
|
--- a/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
|
|
+++ b/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
|
|
@@ -7,7 +7,7 @@
|
|
|
|
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
|
// TODO FMT __builtin_memcpy isn't constexpr in GCC
|
|
-// UNSUPPORTED: gcc-13
|
|
+// UNSUPPORTED: gcc-13, gcc-14
|
|
|
|
// <format>
|
|
|
|
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
|
|
index c9e7bb6a5..0b40ac9ff 100644
|
|
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
|
|
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp
|
|
@@ -8,6 +8,9 @@
|
|
|
|
// UNSUPPORTED: c++03
|
|
|
|
+// FIXME: Why does this start to fail with GCC 14?
|
|
+// XFAIL: gcc-14
|
|
+
|
|
// See https://llvm.org/PR31384.
|
|
|
|
#include <tuple>
|
|
diff --git a/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp b/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp
|
|
index 2c1cbb06e..7429cdf80 100644
|
|
--- a/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp
|
|
+++ b/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp
|
|
@@ -34,6 +34,9 @@ struct overloaded : Ts... {
|
|
using Ts::operator()...;
|
|
};
|
|
|
|
+template <class... Ts>
|
|
+overloaded(Ts...) -> overloaded<Ts...>;
|
|
+
|
|
void test_overload_ambiguity() {
|
|
using V = std::variant<float, long, std::string>;
|
|
using namespace std::string_literals;
|
|
--
|
|
2.45.2
|
|
|