Skip to content
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

Bump compiler mins to gcc12, clang16, xcode16. #1600

Merged
merged 2 commits into from
Jan 29, 2025
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
10 changes: 0 additions & 10 deletions include/bitcoin/system/data/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ inline std::shared_ptr<const Type> to_shared(const Type& value) NOEXCEPT
template <typename Type, typename ...Args>
inline std::shared_ptr<const Type> to_shared(Args&&... values) NOEXCEPT
{
// Type{} required due to CLang bug.
#if defined HAVE_CLANG
return std::make_shared<const Type>(Type{ std::forward<Args>(values)... });
#else
return std::make_shared<const Type>(std::forward<Args>(values)...);
#endif
}

/// Obtain non constant pointer from shared_ptr to const.
Expand Down Expand Up @@ -127,12 +122,7 @@ inline std::unique_ptr<const Type> to_unique(const Type& value) NOEXCEPT
template <typename Type, typename ...Args>
inline std::unique_ptr<const Type> to_unique(Args&&... values) NOEXCEPT
{
// Type{} required due to CLang bug.
#if defined HAVE_CLANG
return std::make_unique<const Type>(Type{ std::forward<Args>(values)... });
#else
return std::make_unique<const Type>(std::forward<Args>(values)...);
#endif
}

BC_POP_WARNING()
Expand Down
14 changes: 7 additions & 7 deletions include/bitcoin/system/have.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,30 +194,30 @@
#define HAVE_STRING_CONSTEXPR
#define HAVE_VECTOR_CONSTEXPR
#elif defined(HAVE_CLANG)
// Apple clang version 15.0.0 (clang-1500.0.40.1)
// Apple clang version 15
#if defined(HAVE_APPLE)
#define HAVE_RANGES
#define HAVE_CONSTEVAL
#define HAVE_STRING_CONSTEXPR
#define HAVE_VECTOR_CONSTEXPR
// Ubuntu clang version 15.0.7
// Ubuntu clang version 16
#else
////#define HAVE_RANGES (v16)
#define HAVE_RANGES
////#define HAVE_CONSTEVAL (v17)
#define HAVE_STRING_CONSTEXPR
#define HAVE_VECTOR_CONSTEXPR
#endif
// gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
// gcc version 12
#elif defined(HAVE_GCC)
#define HAVE_RANGES
#define HAVE_CONSTEVAL
////#define HAVE_STRING_CONSTEXPR (v12)
////#define HAVE_VECTOR_CONSTEXPR (v12)
#define HAVE_STRING_CONSTEXPR
#define HAVE_VECTOR_CONSTEXPR
#endif
#endif

/// C++20: parenthesized initialization of aggregates requires clang16/xcode16.
/// We don't have macro treatment for that, just ad-hoc conditions.
/// We don't have macro treatment for that, just ad-hoc HAVE_CLANG conditions.

/// None on xcode.
/// Requires link with -ltbb on gcc (v9).
Expand Down
10 changes: 5 additions & 5 deletions test/data/integer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ BOOST_AUTO_TEST_CASE(integer__uint256_shift_right__null_hash__null_hash)
{
BOOST_REQUIRE_EQUAL(uint256_t() >> 0, uint256_t());
BOOST_REQUIRE_EQUAL(uint256_t() >> 1, uint256_t());
BOOST_REQUIRE_EQUAL(uint256_t() >> bc::max_uint32, uint256_t());
BOOST_REQUIRE_EQUAL(uint256_t() >> 42, uint256_t());
}

BOOST_AUTO_TEST_CASE(integer__uint256_shift_right__unit_hash_0__unit_hash)
Expand All @@ -301,7 +301,7 @@ BOOST_AUTO_TEST_CASE(integer__uint256_shift_right__unit_hash_positive__null_hash
{
static const uint256_t value(unit_hash);
BOOST_REQUIRE_EQUAL(value >> 1, uint256_t());
BOOST_REQUIRE_EQUAL(value >> bc::max_uint32, uint256_t());
BOOST_REQUIRE_EQUAL(value >> 42, uint256_t());
}

BOOST_AUTO_TEST_CASE(integer__uint256_shift_right__max_hash_1__most_hash)
Expand Down Expand Up @@ -452,7 +452,7 @@ BOOST_AUTO_TEST_CASE(integer__uint256_assign_shift_right__null_hash__null_hash)
uint256_t value3;
value1 >>= 0;
value2 >>= 1;
value3 >>= bc::max_uint32;
value3 >>= 42;
BOOST_REQUIRE_EQUAL(value1, uint256_t());
BOOST_REQUIRE_EQUAL(value2, uint256_t());
BOOST_REQUIRE_EQUAL(value3, uint256_t());
Expand All @@ -470,7 +470,7 @@ BOOST_AUTO_TEST_CASE(integer__uint256_assign_shift_right__unit_hash_positive__nu
uint256_t value1(unit_hash);
uint256_t value2(unit_hash);
value1 >>= 1;
value2 >>= bc::max_uint32;
value2 >>= 42;
BOOST_REQUIRE_EQUAL(value1, uint256_t());
BOOST_REQUIRE_EQUAL(value2, uint256_t());
}
Expand Down Expand Up @@ -499,7 +499,7 @@ BOOST_AUTO_TEST_CASE(integer__uint256_assign_shift_left__null_hash__null_hash)
uint256_t value3;
value1 <<= 0;
value2 <<= 1;
value3 <<= bc::max_uint32;
value3 <<= 42;
BOOST_REQUIRE_EQUAL(value1, uint256_t());
BOOST_REQUIRE_EQUAL(value2, uint256_t());
BOOST_REQUIRE_EQUAL(value3, uint256_t());
Expand Down
Loading