Skip to content

Commit cb7a03b

Browse files
authored
[libc++] Fix failures with GCC 14 (#92663)
Fixes #91831
1 parent 9d4b20a commit cb7a03b

File tree

11 files changed

+22
-8
lines changed

11 files changed

+22
-8
lines changed

libcxx/include/__string/constexpr_c_functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ __constexpr_memcmp_equal(const _Tp* __lhs, const _Up* __rhs, __element_count __n
123123
}
124124
return true;
125125
} else {
126-
return __builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0;
126+
return ::__builtin_memcmp(__lhs, __rhs, __count * sizeof(_Tp)) == 0;
127127
}
128128
}
129129

libcxx/include/__type_traits/remove_pointer.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ struct remove_pointer {
2323
using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
2424
};
2525

26+
# ifdef _LIBCPP_COMPILER_GCC
27+
template <class _Tp>
28+
using __remove_pointer_t = typename remove_pointer<_Tp>::type;
29+
# else
2630
template <class _Tp>
2731
using __remove_pointer_t = __remove_pointer(_Tp);
32+
# endif
2833
#else
2934
// clang-format off
3035
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;};

libcxx/include/bitset

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,11 @@ template <size_t _N_words, size_t _Size>
375375
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX23 unsigned long long
376376
__bitset<_N_words, _Size>::to_ullong(true_type, true_type) const {
377377
unsigned long long __r = __first_[0];
378+
_LIBCPP_DIAGNOSTIC_PUSH
379+
_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wshift-count-overflow")
378380
for (size_t __i = 1; __i < sizeof(unsigned long long) / sizeof(__storage_type); ++__i)
379381
__r |= static_cast<unsigned long long>(__first_[__i]) << (sizeof(__storage_type) * CHAR_BIT);
382+
_LIBCPP_DIAGNOSTIC_POP
380383
return __r;
381384
}
382385

libcxx/test/std/time/time.zone/time.zone.leap/nonmembers/comparison.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// UNSUPPORTED: c++03, c++11, c++14, c++17
1010
// UNSUPPORTED: no-filesystem, no-localization, no-tzdb
1111

12-
// TODO TZDB test whether this can be enabled with gcc 14.
13-
// UNSUPPORTED: gcc-13
12+
// TODO TZDB investigate why this fails with GCC
13+
// UNSUPPORTED: gcc-13, gcc-14
1414

1515
// XFAIL: libcpp-has-no-experimental-tzdb
1616
// XFAIL: availability-tzdb-missing

libcxx/test/std/utilities/expected/expected.expected/monadic/transform.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// GCC has a issue for `Guaranteed copy elision for potentially-overlapping non-static data members`,
1212
// please refer to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108333
13-
// XFAIL: gcc-13
13+
// XFAIL: gcc-13, gcc-14
1414

1515
// <expected>
1616

libcxx/test/std/utilities/expected/expected.expected/monadic/transform_error.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// GCC has a issue for `Guaranteed copy elision for potentially-overlapping non-static data members`,
1212
// please refer to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108333.
13-
// XFAIL: gcc-13
13+
// XFAIL: gcc-13, gcc-14
1414

1515
// <expected>
1616

libcxx/test/std/utilities/expected/expected.void/monadic/transform_error.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// GCC has a issue for `Guaranteed copy elision for potentially-overlapping non-static data members`,
1212
// please refer to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108333
13-
// XFAIL: gcc-13
13+
// XFAIL: gcc-13, gcc-14
1414

1515
// <expected>
1616

libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// UNSUPPORTED: c++03, c++11, c++14, c++17
99
// TODO FMT __builtin_memcpy isn't constexpr in GCC
10-
// UNSUPPORTED: gcc-13
10+
// UNSUPPORTED: gcc-13, gcc-14
1111

1212
// <format>
1313

libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR31384.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
// UNSUPPORTED: c++03
1010

11+
// FIXME: Why does this start to fail with GCC 14?
12+
// XFAIL: gcc-14
13+
1114
// See https://llvm.org/PR31384.
1215

1316
#include <tuple>

libcxx/test/std/utilities/variant/variant.visit.member/visit_return_type.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ struct overloaded : Ts... {
3434
using Ts::operator()...;
3535
};
3636

37+
template <class... Ts>
38+
overloaded(Ts...) -> overloaded<Ts...>;
39+
3740
void test_overload_ambiguity() {
3841
using V = std::variant<float, long, std::string>;
3942
using namespace std::string_literals;

libcxxabi/test/catch_member_function_pointer_02.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
// GCC supports noexcept function types but this test still fails.
1717
// This is likely a bug in their implementation. Investigation needed.
18-
// XFAIL: gcc-13
18+
// XFAIL: gcc-13, gcc-14
1919

2020
#include <cassert>
2121

0 commit comments

Comments
 (0)