Here's the output from make:
./wallet/wallet.h:802:9: required from ‘void wallet::CWallet::WalletLogPrintf(std::string, Params ...) const [with Params = {std::optional<int>}; std::string = std::__cxx11::basic_string<char>]’
wallet/wallet.cpp:2931:44: required from here
./tinyformat.h:291:9: error: no match for ‘operator<<’ (operand types are ‘std::ostringstream’ {aka ‘std::__cxx11::basic_ostringstream<char>’} and ‘const std::optional<int>’)
291 | tmp << value;
| ~~~~^~~~~~~~
./tinyformat.h:291:9: note: candidate: ‘operator<<(int, int)’ (built-in)
...
./wallet/wallet.h:802:9: required from ‘void wallet::CWallet::WalletLogPrintf(std::string, Params ...) const [with Params = {std::optional<int>}; std::string = std::__cxx11::basic_string<char>]’
wallet/wallet.cpp:2931:44: required from here
/usr/include/c++/11.1.0/ostream:773:5: error: no type named ‘type’ in ‘struct std::enable_if<false, std::basic_ostream<char>&>’
In file included from /usr/include/c++/11.1.0/bits/fs_path.h:39,
from /usr/include/c++/11.1.0/filesystem:45,
from ./fs.h:11,
from ./wallet/wallet.h:10,
from wallet/wallet.cpp:6:
./tinyformat.h: In instantiation of ‘void tinyformat::detail::formatTruncated(std::ostream&, const T&, int) [with T = std::optional<int>; std::ostream = std::basic_ostream<char>]’:
./tinyformat.h:355:32: required from ‘void tinyformat::formatValue(std::ostream&, const char*, const char*, int, const T&) [with T = std::optional<int>; std::ostream = std::basic_ostream<char>]’
./tinyformat.h:543:24: required from ‘static void tinyformat::detail::FormatArg::formatImpl(std::ostream&, const char*, const char*, int, const void*) [with T = std::optional<int>; std::ostream = std::basic_ostream<char>]’
./tinyformat.h:519:13: required from ‘tinyformat::detail::FormatArg::FormatArg(const T&) [with T = std::optional<int>]’
./tinyformat.h:975:32: required from ‘tinyformat::detail::FormatListN<N>::FormatListN(const Args& ...) [with Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::optional<int>}; int N = 2]’
./tinyformat.h:1028:20: required from ‘tinyformat::detail::FormatListN<sizeof... (Args)> tinyformat::makeFormatList(const Args& ...) [with Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::optional<int>}]’
./tinyformat.h:1064:37: required from ‘void tinyformat::format(std::ostream&, const char*, const Args& ...) [with Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::optional<int>}; std::ostream = std::basic_ostream<char>]’
./tinyformat.h:1073:11: required from ‘std::string tinyformat::format(const char*, const Args& ...) [with Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::optional<int>}; std::string = std::__cxx11::basic_string<char>]’
Same with clang:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/ostream:276:7: note: candidate function not viable: no known conversion from 'const std::optional<int>' to 'std::basic_ostream<char>::__streambuf_type *' (aka 'basic_streambuf<char, std::char_traits<char>> *') for 1st argument
operator<<(__streambuf_type* __sb);
^
In file included from wallet/wallet.cpp:6:
In file included from ./wallet/wallet.h:10:
In file included from ./fs.h:8:
./tinyformat.h:291:9: error: invalid operands to binary expression ('std::ostringstream' (aka 'basic_ostringstream<char>') and 'const std::optional<int>')
tmp << value;
~~~ ^ ~~~~~