Page MenuHomePhabricator

scheduler: Capture ‘this’ explicitly in lambda
ClosedPublic

Authored by PiRK on Jan 29 2024, 17:16.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCc191cd2f55ca: scheduler: Capture ‘this’ explicitly in lambda
Summary

Without the changes, g++ will warn to compile under C++20:

scheduler.cpp:114:21: warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated]
  114 |     scheduleFromNow([=] { Repeat(*this, f, delta); }, delta);
      |                     ^
scheduler.cpp:114:21: note: add explicit ‘this’ or ‘*this’ capture

This is a partial backport of core#24169
https://github.com/bitcoin/bitcoin/pull/24169/commits/fae2220f4e48934313389864d3d362f672627eb8

Depends on D15314

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Jan 29 2024, 17:16

Tail of the build log:

2 errors generated.
[417/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
FAILED: src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o 
/usr/bin/ccache /usr/bin/clang++ -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wdocumentation -Wformat-security -Wredundant-move -Woverloaded-virtual -Wshadow -Wshadow-field -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++20 -MD -MT src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o -c ../../src/wallet/rpcwallet.cpp
../../src/wallet/rpcwallet.cpp:2634:39: error: no viable conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'const UniValue'
                wallet.pushKV("name", path.u8string());
                                      ^~~~~~~~~~~~~~~
../../src/univalue/include/univalue.h:23:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'const UniValue &' for 1st argument
class UniValue {
      ^
../../src/univalue/include/univalue.h:23:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'UniValue &&' for 1st argument
../../src/univalue/include/univalue.h:30:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'UniValue::VType' for 1st argument
    UniValue(UniValue::VType type, const std::string& value = std::string()) : typ(type), val(value) {}
    ^
../../src/univalue/include/univalue.h:31:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'uint64_t' (aka 'unsigned long') for 1st argument
    UniValue(uint64_t val_) {
    ^
../../src/univalue/include/univalue.h:34:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'int64_t' (aka 'long') for 1st argument
    UniValue(int64_t val_) {
    ^
../../src/univalue/include/univalue.h:37:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'bool' for 1st argument
    UniValue(bool val_) {
    ^
../../src/univalue/include/univalue.h:40:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'int' for 1st argument
    UniValue(int val_) {
    ^
../../src/univalue/include/univalue.h:43:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'double' for 1st argument
    UniValue(double val_) {
    ^
../../src/univalue/include/univalue.h:46:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'const std::string &' (aka 'const basic_string<char> &') for 1st argument
    UniValue(const std::string& val_) {
    ^
../../src/univalue/include/univalue.h:49:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'const char *' for 1st argument
    UniValue(const char *val_) {
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/basic_string.h:787:7: note: candidate function
      operator __sv_type() const noexcept
      ^
../../src/univalue/include/univalue.h:102:57: note: passing argument to parameter 'val' here
    bool pushKV(const std::string& key, const UniValue& val);
                                                        ^
1 error generated.
[418/544] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
FAILED: src/CMakeFiles/server.dir/net_processing.cpp.o 
/usr/bin/ccache /usr/bin/clang++ -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/leveldb/helpers/memenv -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wdocumentation -Wformat-security -Wredundant-move -Woverloaded-virtual -Wshadow -Wshadow-field -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++20 -MD -MT src/CMakeFiles/server.dir/net_processing.cpp.o -MF src/CMakeFiles/server.dir/net_processing.cpp.o.d -o src/CMakeFiles/server.dir/net_processing.cpp.o -c ../../src/net_processing.cpp
../../src/net_processing.cpp:2751:32: error: no matching constructor for initialization of 'CSerializedNetMsg'
                        pnode, CSerializedNetMsg{ser_cmpctblock.data,
                               ^                ~~~~~~~~~~~~~~~~~~~~~
../../src/./net.h:121:5: note: candidate constructor not viable: requires 1 argument, but 2 were provided
    CSerializedNetMsg(CSerializedNetMsg &&) = default;
    ^
../../src/./net.h:124:5: note: candidate constructor not viable: requires single argument 'msg', but 2 arguments were provided
    CSerializedNetMsg(const CSerializedNetMsg &msg) = delete;
    ^
../../src/./net.h:120:5: note: candidate constructor not viable: requires 0 arguments, but 2 were provided
    CSerializedNetMsg() = default;
    ^
1 error generated.
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

Tail of the build log:

/usr/include/c++/9/bits/stl_bvector.h:393:23: note:   no known conversion for argument 1 from ‘std::u8string’ {aka ‘std::__cxx11::basic_string<char8_t>’} to ‘std::ptrdiff_t’ {aka ‘long int’}
  393 |   operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
      |             ~~~~~~~~~~^~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
                 from /usr/include/c++/9/algorithm:61,
                 from ../../src/./span.h:8,
                 from ../../src/./wallet/rpc/backup.h:8,
                 from ../../src/wallet/rpc/backup.cpp:5:
/usr/include/c++/9/bits/stl_iterator.h:996:5: note: candidate: ‘template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)’
  996 |     operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
      |     ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:996:5: note:   template argument deduction/substitution failed:
../../src/wallet/rpc/backup.cpp:965:40: note:   mismatched types ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’ and ‘const char [85]’
  965 |                                        "move it out of the way first");
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/wallet/rpc/backup.cpp:1077:55: error: cannot convert ‘std::u8string’ {aka ‘std::__cxx11::basic_string<char8_t>’} to ‘const UniValue&’
 1077 |             reply.pushKV("filename", filepath.u8string());
      |                                      ~~~~~~~~~~~~~~~~~^~
      |                                                       |
      |                                                       std::u8string {aka std::__cxx11::basic_string<char8_t>}
In file included from ../../src/./rpc/command.h:8,
                 from ../../src/./rpc/server.h:10,
                 from ../../src/wallet/rpc/backup.cpp:14:
../../src/univalue/include/univalue.h:102:57: note:   initializing argument 2 of ‘bool UniValue::pushKV(const string&, const UniValue&)’
  102 |     bool pushKV(const std::string& key, const UniValue& val);
      |                                         ~~~~~~~~~~~~~~~~^~~
[417/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
FAILED: src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DABORT_ON_FAILED_ASSUME -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DDEBUG -DDEBUG_LOCKORDER -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -O0 -fPIC -fvisibility=hidden -g3 -ftrapv -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++2a -MD -MT src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o -c ../../src/wallet/rpcwallet.cpp
../../src/wallet/rpcwallet.cpp: In lambda function:
../../src/wallet/rpcwallet.cpp:2634:52: error: cannot convert ‘std::u8string’ {aka ‘std::__cxx11::basic_string<char8_t>’} to ‘const UniValue&’
 2634 |                 wallet.pushKV("name", path.u8string());
      |                                       ~~~~~~~~~~~~~^~
      |                                                    |
      |                                                    std::u8string {aka std::__cxx11::basic_string<char8_t>}
In file included from ../../src/./rpc/command.h:8,
                 from ../../src/./rpc/server.h:10,
                 from ../../src/wallet/rpcwallet.cpp:19:
../../src/univalue/include/univalue.h:102:57: note:   initializing argument 2 of ‘bool UniValue::pushKV(const string&, const UniValue&)’
  102 |     bool pushKV(const std::string& key, const UniValue& val);
      |                                         ~~~~~~~~~~~~~~~~^~~
[418/544] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
FAILED: src/CMakeFiles/server.dir/net_processing.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DABORT_ON_FAILED_ASSUME -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DDEBUG -DDEBUG_LOCKORDER -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/leveldb/helpers/memenv -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -O0 -fPIC -fvisibility=hidden -g3 -ftrapv -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++2a -MD -MT src/CMakeFiles/server.dir/net_processing.cpp.o -MF src/CMakeFiles/server.dir/net_processing.cpp.o.d -o src/CMakeFiles/server.dir/net_processing.cpp.o -c ../../src/net_processing.cpp
../../src/net_processing.cpp: In lambda function:
../../src/net_processing.cpp:2752:71: error: no matching function for call to ‘CSerializedNetMsg::CSerializedNetMsg(<brace-enclosed initializer list>)’
 2752 |                                                  ser_cmpctblock.m_type});
      |                                                                       ^
In file included from ../../src/./net_processing.h:9,
                 from ../../src/net_processing.cpp:6:
../../src/./net.h:121:5: note: candidate: ‘CSerializedNetMsg::CSerializedNetMsg(CSerializedNetMsg&&)’
  121 |     CSerializedNetMsg(CSerializedNetMsg &&) = default;
      |     ^~~~~~~~~~~~~~~~~
../../src/./net.h:121:5: note:   candidate expects 1 argument, 2 provided
../../src/./net.h:120:5: note: candidate: ‘CSerializedNetMsg::CSerializedNetMsg()’
  120 |     CSerializedNetMsg() = default;
      |     ^~~~~~~~~~~~~~~~~
../../src/./net.h:120:5: note:   candidate expects 0 arguments, 2 provided
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

                 from /usr/include/boost/container_hash/hash.hpp:761,
                 from /usr/include/boost/functional/hash.hpp:6,
                 from /usr/include/boost/multi_index/detail/hash_index_args.hpp:17,
                 from /usr/include/boost/multi_index/hashed_index_fwd.hpp:16,
                 from /usr/include/boost/multi_index/hashed_index.hpp:43,
                 from ../../src/./txmempool.h:21,
                 from ../../src/./validation.h:35,
                 from ../../src/./rpc/blockchain.h:11,
                 from ../../src/rpc/blockchain.cpp:6:
/usr/include/c++/9/complex:450:5: note: candidate: ‘template<class _Tp> constexpr std::complex<_Tp> std::operator+(const std::complex<_Tp>&)’
  450 |     operator+(const complex<_Tp>& __x)
      |     ^~~~~~~~
/usr/include/c++/9/complex:450:5: note:   template argument deduction/substitution failed:
../../src/rpc/blockchain.cpp:3085:40: note:   ‘std::u8string’ {aka ‘std::__cxx11::basic_string<char8_t>’} is not derived from ‘const std::complex<_Tp>’
 3085 |                                        "move it out of the way first");
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
                 from /usr/include/c++/9/algorithm:61,
                 from ../../src/./tinyformat.h:145,
                 from ../../src/./fs.h:8,
                 from ../../src/./rpc/blockchain.h:8,
                 from ../../src/rpc/blockchain.cpp:6:
/usr/include/c++/9/bits/stl_iterator.h:996:5: note: candidate: ‘template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)’
  996 |     operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
      |     ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:996:5: note:   template argument deduction/substitution failed:
../../src/rpc/blockchain.cpp:3085:40: note:   mismatched types ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’ and ‘const char [85]’
 3085 |                                        "move it out of the way first");
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/rpc/blockchain.cpp: In function ‘UniValue CreateUTXOSnapshot(node::NodeContext&, Chainstate&, AutoFile&, const fs::path&, const fs::path&)’:
../../src/rpc/blockchain.cpp:3171:40: error: cannot convert ‘std::u8string’ {aka ‘std::__cxx11::basic_string<char8_t>’} to ‘const UniValue&’
 3171 |     result.pushKV("path", path.u8string());
      |                           ~~~~~~~~~~~~~^~
      |                                        |
      |                                        std::u8string {aka std::__cxx11::basic_string<char8_t>}
In file included from ../../src/./rpc/blockchain.h:13,
                 from ../../src/rpc/blockchain.cpp:6:
../../src/univalue/include/univalue.h:102:57: note:   initializing argument 2 of ‘bool UniValue::pushKV(const string&, const UniValue&)’
  102 |     bool pushKV(const std::string& key, const UniValue& val);
      |                                         ~~~~~~~~~~~~~~~~^~~
[514/607] Linking CXX executable src/bitcoin-chainstate
[515/607] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
FAILED: src/CMakeFiles/server.dir/net_processing.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/leveldb/helpers/memenv -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++2a -MD -MT src/CMakeFiles/server.dir/net_processing.cpp.o -MF src/CMakeFiles/server.dir/net_processing.cpp.o.d -o src/CMakeFiles/server.dir/net_processing.cpp.o -c ../../src/net_processing.cpp
../../src/net_processing.cpp: In lambda function:
../../src/net_processing.cpp:2752:71: error: no matching function for call to ‘CSerializedNetMsg::CSerializedNetMsg(<brace-enclosed initializer list>)’
 2752 |                                                  ser_cmpctblock.m_type});
      |                                                                       ^
In file included from ../../src/./net_processing.h:9,
                 from ../../src/net_processing.cpp:6:
../../src/./net.h:121:5: note: candidate: ‘CSerializedNetMsg::CSerializedNetMsg(CSerializedNetMsg&&)’
  121 |     CSerializedNetMsg(CSerializedNetMsg &&) = default;
      |     ^~~~~~~~~~~~~~~~~
../../src/./net.h:121:5: note:   candidate expects 1 argument, 2 provided
../../src/./net.h:120:5: note: candidate: ‘CSerializedNetMsg::CSerializedNetMsg()’
  120 |     CSerializedNetMsg() = default;
      |     ^~~~~~~~~~~~~~~~~
../../src/./net.h:120:5: note:   candidate expects 0 arguments, 2 provided
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

                 from ../../src/./wallet/rpc/backup.h:8,
                 from ../../src/wallet/rpc/backup.cpp:5:
/usr/include/c++/9/bits/stl_bvector.h:303:3: note: candidate: ‘std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)’
  303 |   operator+(ptrdiff_t __n, const _Bit_iterator& __x)
      |   ^~~~~~~~
/usr/include/c++/9/bits/stl_bvector.h:303:23: note:   no known conversion for argument 1 from ‘std::u8string’ {aka ‘std::__cxx11::basic_string<char8_t>’} to ‘std::ptrdiff_t’ {aka ‘long int’}
  303 |   operator+(ptrdiff_t __n, const _Bit_iterator& __x)
      |             ~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_bvector.h:393:3: note: candidate: ‘std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)’
  393 |   operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
      |   ^~~~~~~~
/usr/include/c++/9/bits/stl_bvector.h:393:23: note:   no known conversion for argument 1 from ‘std::u8string’ {aka ‘std::__cxx11::basic_string<char8_t>’} to ‘std::ptrdiff_t’ {aka ‘long int’}
  393 |   operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
      |             ~~~~~~~~~~^~~
In file included from /usr/include/c++/9/bits/stl_algobase.h:67,
                 from /usr/include/c++/9/algorithm:61,
                 from ../../src/./span.h:8,
                 from ../../src/./wallet/rpc/backup.h:8,
                 from ../../src/wallet/rpc/backup.cpp:5:
/usr/include/c++/9/bits/stl_iterator.h:996:5: note: candidate: ‘template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)’
  996 |     operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
      |     ^~~~~~~~
/usr/include/c++/9/bits/stl_iterator.h:996:5: note:   template argument deduction/substitution failed:
../../src/wallet/rpc/backup.cpp:965:40: note:   mismatched types ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’ and ‘const char [85]’
  965 |                                        "move it out of the way first");
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/wallet/rpc/backup.cpp:1077:55: error: cannot convert ‘std::u8string’ {aka ‘std::__cxx11::basic_string<char8_t>’} to ‘const UniValue&’
 1077 |             reply.pushKV("filename", filepath.u8string());
      |                                      ~~~~~~~~~~~~~~~~~^~
      |                                                       |
      |                                                       std::u8string {aka std::__cxx11::basic_string<char8_t>}
In file included from ../../src/./rpc/command.h:8,
                 from ../../src/./rpc/server.h:10,
                 from ../../src/wallet/rpc/backup.cpp:14:
../../src/univalue/include/univalue.h:102:57: note:   initializing argument 2 of ‘bool UniValue::pushKV(const string&, const UniValue&)’
  102 |     bool pushKV(const std::string& key, const UniValue& val);
      |                                         ~~~~~~~~~~~~~~~~^~~
[398/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[399/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[400/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[401/544] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[402/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[403/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[404/544] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[405/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[406/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[407/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[408/544] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[409/544] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[410/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[411/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[412/544] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[413/544] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[414/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[415/544] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[416/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[417/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[418/544] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

Tail of the build log:

../../src/univalue/include/univalue.h:23:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'UniValue &&' for 1st argument
../../src/univalue/include/univalue.h:30:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'UniValue::VType' for 1st argument
    UniValue(UniValue::VType type, const std::string& value = std::string()) : typ(type), val(value) {}
    ^
../../src/univalue/include/univalue.h:31:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'uint64_t' (aka 'unsigned long') for 1st argument
    UniValue(uint64_t val_) {
    ^
../../src/univalue/include/univalue.h:34:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'int64_t' (aka 'long') for 1st argument
    UniValue(int64_t val_) {
    ^
../../src/univalue/include/univalue.h:37:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'bool' for 1st argument
    UniValue(bool val_) {
    ^
../../src/univalue/include/univalue.h:40:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'int' for 1st argument
    UniValue(int val_) {
    ^
../../src/univalue/include/univalue.h:43:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'double' for 1st argument
    UniValue(double val_) {
    ^
../../src/univalue/include/univalue.h:46:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'const std::string &' (aka 'const basic_string<char> &') for 1st argument
    UniValue(const std::string& val_) {
    ^
../../src/univalue/include/univalue.h:49:5: note: candidate constructor not viable: no known conversion from 'std::u8string' (aka 'basic_string<char8_t>') to 'const char *' for 1st argument
    UniValue(const char *val_) {
    ^
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/basic_string.h:787:7: note: candidate function
      operator __sv_type() const noexcept
      ^
../../src/univalue/include/univalue.h:102:57: note: passing argument to parameter 'val' here
    bool pushKV(const std::string& key, const UniValue& val);
                                                        ^
4258 warnings and 1 error generated.
Error while processing /work/abc-ci-builds/build-clang-tidy/../../src/wallet/rpcwallet.cpp.
Suppressed 4258 warnings (4254 in non-user code, 4 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
[396/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[397/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[398/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[399/542] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[400/542] Linking CXX static library src/zmq/libzmq.a
[401/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[402/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[403/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[404/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[405/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[406/542] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[407/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[408/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[409/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[410/542] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[411/542] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[412/542] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[413/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[414/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[415/542] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[416/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[417/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

[361/542] Linking C executable src/secp256k1/verify-bench
[362/542] Linking C executable src/secp256k1/sign-bench
[363/542] Building CXX object src/CMakeFiles/server.dir/rpc/avalanche.cpp.o
[364/542] Building CXX object src/CMakeFiles/server.dir/txdb.cpp.o
[365/542] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[366/542] Linking C executable src/secp256k1/internal-bench
[367/542] Building CXX object src/CMakeFiles/server.dir/validationinterface.cpp.o
[368/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[369/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[370/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[371/542] Building CXX object src/CMakeFiles/server.dir/txorphanage.cpp.o
[372/542] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[373/542] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[374/542] Linking CXX executable src/bitcoin-cli
[375/542] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[376/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[377/542] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[378/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[379/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[380/542] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[381/542] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[382/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[383/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[384/542] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[385/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[386/542] Linking CXX executable src/bitcoin-tx
[387/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[388/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[389/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[390/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[391/542] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[392/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[393/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[394/542] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[395/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[396/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[397/542] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[398/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[399/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[400/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[401/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[402/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[403/542] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[404/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[405/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[406/542] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[407/542] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[408/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[409/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[410/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[411/542] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[412/542] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[413/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[414/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[415/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[416/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[417/542] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[418/542] Linking CXX static library src/wallet/libwallet.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1
Fabien requested changes to this revision.Jan 30 2024, 08:32
Fabien added a subscriber: Fabien.

Needs rebase after clang-tidy is fixed in the dependency

This revision now requires changes to proceed.Jan 30 2024, 08:32
This revision is now accepted and ready to land.Jan 30 2024, 15:30