Skip to content

Commit dbadf74

Browse files
committed
Merge #19333: refactor: Fix clang compile failure
fa3b35a ci: Add test for clang-3.8 C++11 support (MarcoFalke) faa7431 refactor: Fix clang compile failure (MarcoFalke) Pull request description: Fix ``` script/standard.cpp:278:22: error: default initialization of an object of const type 'const (anonymous namespace)::CScriptVisitor' without a user-provided default constructor const CScriptVisitor g_script_visitor; ^ {} 1 error generated. ACKs for top commit: laanwj: ACK fa3b35a Tree-SHA512: b3251208945b44530224aadbc10fef1260b479c0b43a5e345501fbfd3579a9fe354b946090e023232852bbb99759da4429b58b137b7b286ddac6bd7960851f7f
2 parents 1269cab + fa3b35a commit dbadf74

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

ci/test/00_setup_env_native_nowallet.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_nowallet
1010
export DOCKER_NAME_TAG=ubuntu:16.04 # Use xenial to have one config run the tests in python3.5, see doc/dependencies.md
11-
export PACKAGES="python3-zmq"
11+
export PACKAGES="python3-zmq clang-3.8 llvm-3.8" # Use clang-3.8 to test C++11 compatibility, see doc/dependencies.md
1212
export DEP_OPTS="NO_WALLET=1"
1313
export GOAL="install"
14-
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
14+
export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports CC=clang-3.8 CXX=clang++-3.8"

src/script/standard.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,11 @@ class CScriptVisitor : public boost::static_visitor<CScript>
290290
return CScript() << CScript::EncodeOP_N(id.version) << std::vector<unsigned char>(id.program, id.program + id.length);
291291
}
292292
};
293-
294-
const CScriptVisitor g_script_visitor;
295-
296293
} // namespace
297294

298295
CScript GetScriptForDestination(const CTxDestination& dest)
299296
{
300-
return boost::apply_visitor(::g_script_visitor, dest);
297+
return boost::apply_visitor(CScriptVisitor{}, dest);
301298
}
302299

303300
CScript GetScriptForRawPubKey(const CPubKey& pubKey)

0 commit comments

Comments
 (0)