Skip to content

Commit 7a65bac

Browse files
authored
Merge pull request #1758 from evoskuil/master
Remove consteval conditionality (clang18).
2 parents fdece77 + 569c6f4 commit 7a65bac

22 files changed

Lines changed: 51 additions & 169 deletions

include/bitcoin/system/data/array_cast.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace system {
4444

4545
/// Generate array sequence from [0..sub1(Size)] of Integer.
4646
template<typename Integer, size_t Size>
47-
CONSTEVAL std_array<Integer, Size> to_sequence() NOEXCEPT;
47+
consteval std_array<Integer, Size> to_sequence() NOEXCEPT;
4848

4949
/// Non-function alias for to_sequence().
5050
template <typename Integer, size_t Size>

include/bitcoin/system/filter/sieve.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ class sieve
7070
using offsets_t = std_array<type, screens>;
7171

7272
/// Generate compression offsets at compile time.
73-
static CONSTEVAL offsets_t generate_offsets() NOEXCEPT;
73+
static consteval offsets_t generate_offsets() NOEXCEPT;
7474

7575
/// Generate compressed mask table at compile time.
76-
static CONSTEVAL masks_t generate_masks() NOEXCEPT;
76+
static consteval masks_t generate_masks() NOEXCEPT;
7777

7878
/// Read member compressed mask array as if it was a two-dimesional array.
7979
static constexpr type masks(size_t row, size_t column) NOEXCEPT;

include/bitcoin/system/hash/accumulator.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ class accumulator
154154
INLINE constexpr size_t pad_size() const NOEXCEPT;
155155

156156
/// Precomputed streaming pad buffer and hashes for empty data.
157-
static CONSTEVAL block_t stream_pad() NOEXCEPT;
158-
static CONSTEVAL digest_t empty_single() NOEXCEPT;
159-
static CONSTEVAL digest_t empty_double() NOEXCEPT;
157+
static consteval block_t stream_pad() NOEXCEPT;
158+
static consteval digest_t empty_single() NOEXCEPT;
159+
static consteval digest_t empty_double() NOEXCEPT;
160160

161161
private:
162162
size_t size_;

include/bitcoin/system/hash/hmac.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class hmac
5050
using byte_t = typename Algorithm::byte_t;
5151
using block_t = typename Algorithm::block_t;
5252

53-
static CONSTEVAL block_t inner_pad() NOEXCEPT;
54-
static CONSTEVAL block_t outer_pad() NOEXCEPT;
53+
static consteval block_t inner_pad() NOEXCEPT;
54+
static consteval block_t outer_pad() NOEXCEPT;
5555
static constexpr block_t& xor_n(block_t& pad, const byte_t* from,
5656
size_t size) NOEXCEPT;
5757

include/bitcoin/system/hash/rmd/algorithm.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class algorithm
116116
/// -----------------------------------------------------------------------
117117

118118
template<size_t Round, typename Auto>
119-
static CONSTEVAL auto functor() NOEXCEPT;
119+
static consteval auto functor() NOEXCEPT;
120120

121121
template<size_t Round>
122122
INLINE static constexpr auto round(auto& a, auto b, auto c, auto d,
@@ -148,9 +148,9 @@ class algorithm
148148
using pad_t = std_array<word_t, subtract(RMD::block_words,
149149
count_bytes / RMD::word_bytes)>;
150150

151-
static CONSTEVAL words_t block_pad() NOEXCEPT;
152-
static CONSTEVAL chunk_t chunk_pad() NOEXCEPT;
153-
static CONSTEVAL pad_t stream_pad() NOEXCEPT;
151+
static consteval words_t block_pad() NOEXCEPT;
152+
static consteval chunk_t chunk_pad() NOEXCEPT;
153+
static consteval pad_t stream_pad() NOEXCEPT;
154154
};
155155

156156
} // namespace rmd

include/bitcoin/system/hash/scrypt.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class scrypt
9797
static inline bool romix(rblock_t& rblock) NOEXCEPT;
9898

9999
private:
100-
static CONSTEVAL auto& concurrency() NOEXCEPT;
100+
static consteval auto& concurrency() NOEXCEPT;
101101
};
102102

103103
/// Litecoin/BIP38 scrypt arguments.

include/bitcoin/system/hash/sha/algorithm.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class algorithm
236236
INLINE static constexpr auto extract(Word a) NOEXCEPT;
237237

238238
template<size_t Round, typename Auto>
239-
static CONSTEVAL auto functor() NOEXCEPT;
239+
static consteval auto functor() NOEXCEPT;
240240

241241
template <size_t Round>
242242
INLINE static constexpr void round(auto a, auto& b, auto c, auto d,
@@ -286,7 +286,7 @@ class algorithm
286286

287287
/// Scheduled padding (new and existing buffer objects).
288288
template <size_t Blocks>
289-
static CONSTEVAL buffer_t scheduled_pad() NOEXCEPT;
289+
static consteval buffer_t scheduled_pad() NOEXCEPT;
290290
template <size_t Blocks>
291291
static constexpr void schedule_n(buffer_t& buffer) NOEXCEPT;
292292
static constexpr void schedule_n(buffer_t& buffer, size_t blocks) NOEXCEPT;
@@ -295,8 +295,8 @@ class algorithm
295295
/// Unscheduled padding (new objects).
296296
template <size_t Bytes>
297297
static constexpr void simple_pad(block_t& block) NOEXCEPT;
298-
static CONSTEVAL chunk_t chunk_pad() NOEXCEPT;
299-
static CONSTEVAL pad_t stream_pad() NOEXCEPT;
298+
static consteval chunk_t chunk_pad() NOEXCEPT;
299+
static consteval pad_t stream_pad() NOEXCEPT;
300300
static words_t pad_block() NOEXCEPT;
301301
static words_t pad_blocks(count_t blocks) NOEXCEPT;
302302

include/bitcoin/system/have.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -263,27 +263,6 @@
263263
#define HAVE_CPP20
264264
#endif
265265

266-
// Support for C++20 features we use varies.
267-
// en.cppreference.com/w/cpp/compiler_support
268-
// These are based on the compiler versions we test with, shown below.
269-
#if defined(HAVE_CPP20)
270-
// All versions.
271-
#if defined(HAVE_MSC)
272-
#define HAVE_CONSTEVAL
273-
#elif defined(HAVE_CLANG)
274-
// Apple clang version 15
275-
#if defined(HAVE_APPLE)
276-
#define HAVE_CONSTEVAL
277-
// Ubuntu clang version 16
278-
#else
279-
////#define HAVE_CONSTEVAL (v17)
280-
#endif
281-
// gcc version 12
282-
#elif defined(HAVE_GNUC)
283-
#define HAVE_CONSTEVAL
284-
#endif
285-
#endif
286-
287266
/// These are manually configured here.
288267
/// ---------------------------------------------------------------------------
289268

include/bitcoin/system/impl/data/array_cast.ipp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ BC_PUSH_WARNING(USE_CONSTEXPR_FOR_FUNCTION)
3535

3636
// Helper to extract Index parameter pack from std::make_index_sequence<Size>.
3737
template<typename Integer, size_t Size, size_t... Index>
38-
CONSTEVAL auto to_array(std::index_sequence<Index...>) NOEXCEPT
38+
consteval auto to_array(std::index_sequence<Index...>) NOEXCEPT
3939
{
4040
return std_array<Integer, Size>{ { Index... } };
4141
}
4242

4343
template<typename Integer, size_t Size>
44-
CONSTEVAL std_array<Integer, Size> to_sequence() NOEXCEPT
44+
consteval std_array<Integer, Size> to_sequence() NOEXCEPT
4545
{
4646
return to_array<Integer, Size>(std::make_index_sequence<Size>{});
4747
}

include/bitcoin/system/impl/filter/sieve.ipp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ constexpr CLASS::type CLASS::masks(size_t row, size_t column) NOEXCEPT
171171
}
172172

173173
TEMPLATE
174-
CONSTEVAL CLASS::offsets_t CLASS::generate_offsets() NOEXCEPT
174+
consteval CLASS::offsets_t CLASS::generate_offsets() NOEXCEPT
175175
{
176176
// Generate compression offsets at compile, generally 16 or 32 elements.
177177
offsets_t offsets{};
@@ -184,7 +184,7 @@ CONSTEVAL CLASS::offsets_t CLASS::generate_offsets() NOEXCEPT
184184
// Logically sparse, e.g. 16 x 16 = 256 table of uint32_t (1024 bytes).
185185
// Compressed to one-dimensional 136 element array of uint32_t (544 bytes).
186186
TEMPLATE
187-
CONSTEVAL CLASS::masks_t CLASS::generate_masks() NOEXCEPT
187+
consteval CLASS::masks_t CLASS::generate_masks() NOEXCEPT
188188
{
189189
constexpr auto off = generate_offsets();
190190

0 commit comments

Comments
 (0)