diff --git a/include/bitcoin/system/data/memory.hpp b/include/bitcoin/system/data/memory.hpp index 376e2430bf..f7157ae4c9 100644 --- a/include/bitcoin/system/data/memory.hpp +++ b/include/bitcoin/system/data/memory.hpp @@ -66,12 +66,7 @@ inline std::shared_ptr to_shared(const Type& value) NOEXCEPT template inline std::shared_ptr to_shared(Args&&... values) NOEXCEPT { -// Type{} required due to CLang bug. -#if defined HAVE_CLANG - return std::make_shared(Type{ std::forward(values)... }); -#else return std::make_shared(std::forward(values)...); -#endif } /// Obtain non constant pointer from shared_ptr to const. @@ -127,12 +122,7 @@ inline std::unique_ptr to_unique(const Type& value) NOEXCEPT template inline std::unique_ptr to_unique(Args&&... values) NOEXCEPT { - // Type{} required due to CLang bug. -#if defined HAVE_CLANG - return std::make_unique(Type{ std::forward(values)... }); -#else return std::make_unique(std::forward(values)...); -#endif } BC_POP_WARNING() diff --git a/include/bitcoin/system/have.hpp b/include/bitcoin/system/have.hpp index 66bbd90709..41915e43cb 100644 --- a/include/bitcoin/system/have.hpp +++ b/include/bitcoin/system/have.hpp @@ -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). diff --git a/test/data/integer.cpp b/test/data/integer.cpp index 0a4dda8669..c4327362f2 100644 --- a/test/data/integer.cpp +++ b/test/data/integer.cpp @@ -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) @@ -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) @@ -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()); @@ -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()); } @@ -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());