Skip to content

Commit 9a8e5ad

Browse files
committed
Merge bitcoin/bitcoin#31267: refactor: Drop deprecated space in operator""_mst
faf2162 refactor: Drop deprecated space in operator""_mst (MarcoFalke) Pull request description: The space is deprecated according to https://en.cppreference.com/w/cpp/language/user_literal#Literal_operators and compilers will start to warn about this. For example, GCC-15 should warn when compiling under C++23, according to https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-Wdeprecated-literal-operator and Clang-20 will do so by default, according to https://clang.llvm.org/docs/DiagnosticsReference.html#wdeprecated-literal-operator. Fix it by removing the unused and deprecated space. Also, fix the iwyu include list, while touching the module. ACKs for top commit: TheCharlatan: ACK faf2162 l0rinc: ACK faf2162 Tree-SHA512: 888a7b57c91114e1f71b6278fa13783bde16a9b51f4df10ae4b6c7d62bf016d6c022128250e6962b459f66743ddeab774b4109064281654892ecdb5bc11b6be6
2 parents af60887 + faf2162 commit 9a8e5ad

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

src/script/miniscript.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
// Copyright (c) 2019-2022 The Bitcoin Core developers
1+
// Copyright (c) 2019-present The Bitcoin Core developers
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <string>
5+
#include <limits>
66
#include <vector>
7-
#include <script/script.h>
8-
#include <script/miniscript.h>
9-
#include <serialize.h>
107

11-
#include <assert.h>
8+
#include <primitives/transaction.h>
9+
#include <script/miniscript.h>
10+
#include <script/script.h>
11+
#include <script/solver.h>
12+
#include <span.h>
13+
#include <util/check.h>
14+
#include <util/vector.h>
1215

1316
namespace miniscript {
1417
namespace internal {

src/script/miniscript.h

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
// Copyright (c) 2019-2022 The Bitcoin Core developers
1+
// Copyright (c) 2019-present The Bitcoin Core developers
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#ifndef BITCOIN_SCRIPT_MINISCRIPT_H
66
#define BITCOIN_SCRIPT_MINISCRIPT_H
77

88
#include <algorithm>
9-
#include <functional>
10-
#include <numeric>
9+
#include <compare>
10+
#include <cstdint>
11+
#include <cstdlib>
12+
#include <iterator>
1113
#include <memory>
1214
#include <optional>
13-
#include <string>
15+
#include <set>
16+
#include <stdexcept>
17+
#include <tuple>
18+
#include <utility>
1419
#include <vector>
1520

16-
#include <assert.h>
17-
#include <cstdlib>
18-
21+
#include <consensus/consensus.h>
1922
#include <policy/policy.h>
20-
#include <primitives/transaction.h>
23+
#include <script/interpreter.h>
2124
#include <script/parsing.h>
2225
#include <script/script.h>
26+
#include <serialize.h>
2327
#include <span.h>
2428
#include <util/check.h>
2529
#include <util/strencodings.h>
@@ -150,7 +154,8 @@ class Type {
150154
};
151155

152156
//! Literal operator to construct Type objects.
153-
inline consteval Type operator"" _mst(const char* c, size_t l) {
157+
inline consteval Type operator""_mst(const char* c, size_t l)
158+
{
154159
Type typ{Type::Make(0)};
155160

156161
for (const char *p = c; p < c + l; p++) {

src/test/fuzz/miniscript.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ using NodeRef = miniscript::NodeRef<CPubKey>;
2222
using Node = miniscript::Node<CPubKey>;
2323
using Type = miniscript::Type;
2424
using MsCtx = miniscript::MiniscriptContext;
25-
using miniscript::operator"" _mst;
25+
using miniscript::operator""_mst;
2626

2727
//! Some pre-computed data for more efficient string roundtrips and to simulate challenges.
2828
struct TestData {

src/test/miniscript_tests.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class TestSignatureChecker : public BaseSignatureChecker {
293293

294294
using Fragment = miniscript::Fragment;
295295
using NodeRef = miniscript::NodeRef<CPubKey>;
296-
using miniscript::operator"" _mst;
296+
using miniscript::operator""_mst;
297297
using Node = miniscript::Node<CPubKey>;
298298

299299
/** Compute all challenges (pubkeys, hashes, timelocks) that occur in a given Miniscript. */

0 commit comments

Comments
 (0)