Skip to content

[libc++] Fix failures with GCC 14 #92663

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

Merged
merged 1 commit into from
Jun 1, 2024
Merged
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
2 changes: 1 addition & 1 deletion libcxx/include/__string/constexpr_c_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
5 changes: 5 additions & 0 deletions libcxx/include/__type_traits/remove_pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;};
Expand Down
3 changes: 3 additions & 0 deletions libcxx/include/bitset
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

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

These are really expensive. I think you should guard them to they only push-pop with GCC.

_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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libcxxabi/test/catch_member_function_pointer_02.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

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

#include <cassert>

Expand Down
Loading