$ clang++ --version
Ubuntu clang version 22.0.0 (++20251003081846+36dc2a941f53-1~exp1~20251003202013.1205)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-22/bin
$ cmake --build build -j 1
[4/447] Building CXX object src/CMakeFiles/bitcoin_node.dir/mapport.cpp.o
FAILED: src/CMakeFiles/bitcoin_node.dir/mapport.cpp.o
/usr/bin/ccache /usr/bin/clang++-22 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -I/home/hebasto/dev/bitcoin/build/src -I/home/hebasto/dev/bitcoin/src -I/home/hebasto/dev/bitcoin/src/leveldb/include -I/home/hebasto/dev/bitcoin/src/minisketch/include -I/home/hebasto/dev/bitcoin/src/univalue/include -O2 -g -std=c++20 -fPIC -fdebug-prefix-map=/home/hebasto/dev/bitcoin/src=. -fmacro-prefix-map=/home/hebasto/dev/bitcoin/src=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wthread-safety-pointer -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -MD -MT src/CMakeFiles/bitcoin_node.dir/mapport.cpp.o -MF src/CMakeFiles/bitcoin_node.dir/mapport.cpp.o.d -o src/CMakeFiles/bitcoin_node.dir/mapport.cpp.o -c /home/hebasto/dev/bitcoin/src/mapport.cpp
../src/mapport.cpp:115:59: error: no matching member function for call to 'randrange'
115 | sleep_time = sleep_time_min + FastRandomContext().randrange<std::chrono::milliseconds>(sleep_time_max - sleep_time_min);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/random.h:254:7: note: candidate template ignored: constraints not satisfied [with I = std::chrono::milliseconds]
254 | I randrange(I range) noexcept
| ^
../src/random.h:253:14: note: because 'std::chrono::milliseconds' (aka 'duration<long, ratio<1, 1000>>') does not satisfy 'integral'
253 | template<std::integral I>
| ^
/usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/concepts:107:24: note: because 'is_integral_v<std::chrono::duration<long, std::ratio<1, 1000>>>' evaluated to false
107 | concept integral = is_integral_v<_Tp>;
| ^
../src/random.h:346:9: note: candidate template ignored: constraints not satisfied [with Dur = std::chrono::milliseconds]
346 | Dur randrange(std::common_type_t<Dur> range) noexcept
| ^
../src/random.h:345:15: note: because 'std::chrono::milliseconds' (aka 'duration<long, ratio<1, 1000>>') does not satisfy 'StdChronoDuration'
345 | template <StdChronoDuration Dur>
| ^
../src/random.h:157:5: note: because '[]<class Rep, class Period>(std::type_identity<std::chrono::duration<Rep, Period>>) {
}(std::type_identity<T>())' would be invalid: no matching function for call to object of type '(lambda at ../src/random.h:157:5)'
157 | []<class Rep, class Period>(std::type_identity<std::chrono::duration<Rep, Period>>){}(
| ^
1 error generated.
ninja: build stopped: subcommand failed.
-
hebasto commented at 9:54 AM on October 4, 2025: member
-
sipa commented at 1:16 PM on October 4, 2025: member
I can't reproduce this on godbolt. Does the code there work for you? https://godbolt.org/z/f7E4Y7rrb
-
hebasto commented at 1:20 PM on October 4, 2025: member
I can't reproduce this on godbolt. Does the code there work for you? https://godbolt.org/z/f7E4Y7rrb
It does. No issues.
-
sipa commented at 1:25 PM on October 4, 2025: member
That makes no sense!
The warning above complains:
../src/random.h:345:15: note: because 'std::chrono::milliseconds' (aka 'duration<long, ratio<1, 1000>>') does not satisfy 'StdChronoDuration' 345 | template <StdChronoDuration Dur> | ^And yet, the godbolt snippet invokes
rand, which is templated astemplate <StdChronoDuration Dur>just the same, withstd::chrono::millisecondsas argument.Compiler bug, which is hopefully resolved before they release?
- bitcoin deleted a comment on Oct 4, 2025
- fanquake closed this on Oct 4, 2025
- fanquake added the label Upstream on Oct 4, 2025
-
maflcko commented at 7:01 AM on October 13, 2025: member
-
hebasto commented at 10:32 AM on October 16, 2025: member
The snapshot containing the fix builds successfully: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/18549098308.