Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#31267: refactor: Drop deprecated space in opera…
Browse files Browse the repository at this point in the history
…tor""_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
  • Loading branch information
fanquake committed Nov 11, 2024
2 parents af60887 + faf2162 commit 9a8e5ad
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
15 changes: 9 additions & 6 deletions src/script/miniscript.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// Copyright (c) 2019-2022 The Bitcoin Core developers
// Copyright (c) 2019-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <string>
#include <limits>
#include <vector>
#include <script/script.h>
#include <script/miniscript.h>
#include <serialize.h>

#include <assert.h>
#include <primitives/transaction.h>
#include <script/miniscript.h>
#include <script/script.h>
#include <script/solver.h>
#include <span.h>
#include <util/check.h>
#include <util/vector.h>

namespace miniscript {
namespace internal {
Expand Down
23 changes: 14 additions & 9 deletions src/script/miniscript.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
// Copyright (c) 2019-2022 The Bitcoin Core developers
// Copyright (c) 2019-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_SCRIPT_MINISCRIPT_H
#define BITCOIN_SCRIPT_MINISCRIPT_H

#include <algorithm>
#include <functional>
#include <numeric>
#include <compare>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <memory>
#include <optional>
#include <string>
#include <set>
#include <stdexcept>
#include <tuple>
#include <utility>
#include <vector>

#include <assert.h>
#include <cstdlib>

#include <consensus/consensus.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <script/interpreter.h>
#include <script/parsing.h>
#include <script/script.h>
#include <serialize.h>
#include <span.h>
#include <util/check.h>
#include <util/strencodings.h>
Expand Down Expand Up @@ -150,7 +154,8 @@ class Type {
};

//! Literal operator to construct Type objects.
inline consteval Type operator"" _mst(const char* c, size_t l) {
inline consteval Type operator""_mst(const char* c, size_t l)
{
Type typ{Type::Make(0)};

for (const char *p = c; p < c + l; p++) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/fuzz/miniscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using NodeRef = miniscript::NodeRef<CPubKey>;
using Node = miniscript::Node<CPubKey>;
using Type = miniscript::Type;
using MsCtx = miniscript::MiniscriptContext;
using miniscript::operator"" _mst;
using miniscript::operator""_mst;

//! Some pre-computed data for more efficient string roundtrips and to simulate challenges.
struct TestData {
Expand Down
2 changes: 1 addition & 1 deletion src/test/miniscript_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class TestSignatureChecker : public BaseSignatureChecker {

using Fragment = miniscript::Fragment;
using NodeRef = miniscript::NodeRef<CPubKey>;
using miniscript::operator"" _mst;
using miniscript::operator""_mst;
using Node = miniscript::Node<CPubKey>;

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

0 comments on commit 9a8e5ad

Please sign in to comment.