Skip to content

[wip,nomerge,rfc] build: Require C++23 compiler - #36033

Draft
maflcko wants to merge 13 commits into
bitcoin:masterfrom
maflcko:2608-cpp23
Draft

maflcko wants to merge 13 commits into
bitcoin:masterfrom
maflcko:2608-cpp23

Conversation

@maflcko

@maflcko maflcko commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

C++23 for Bitcoin Core is mostly a "style update" on top of C++20. However, the workarounds to avoid C++23 keep accumulating and some parts of the code already use C++23 features, such as lambda attributes (bitcoin-core/libmultiprocess@bdd0cd6).

I don't know when it is fine to switch, but at some point, I think it is fine to require a C++23 compiler, so that new stuff is unlocked. Of course this requires bumping the minimum required compiler versions:

  • GCC: 13
  • Clang: 19

There are some C++23 features that aren't implemented (such as <stacktrace> not really shipped in any vanilla stdlib today), or e.g. ranges::starts_with not implemented until libstdc++-16. But overall I think we are better off using C++23 without those few features instead of waiting longer?

@DrahtBot DrahtBot changed the title [wip,nomerge,rfc] build: Require C++23 compiler [wip,nomerge,rfc] build: Require C++23 compiler Aug 20, 2026
@DrahtBot

DrahtBot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Concept ACK l0rinc

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #37018 (descriptor: fix InferScript creates invalid descriptors for invalid pubkeys by Eunovo)
  • #36994 (net: reduce ASMap lookup and address grouping costs by l0rinc)
  • #36980 (log: mask SENSITIVE rw_settings in LogArgs by enessubass)
  • #36976 (rpc: Use OBJ_NAMED_PARAMS in estimatesmartfee by maflcko)
  • #36858 (refactor: break the blockstorage/validation circular dependency by pzafonte)
  • #36856 (kernel: add manual pruning by pzafonte)
  • #36839 (build: explicitly disable cl.exe by bartoli)
  • #36738 (refactor: move block writes and pruning into BlockManager by pzafonte)
  • #36434 (http: support unix sockets by pinheadmz)
  • #36255 (Refactor CoinGrinder tests by murchandamus)
  • #36049 (streams: handle buffered write failures outside the destructor by l0rinc)
  • #35940 (net: add bip152hb permission to select BIP152 high-bandwidth peers by w0xlt)
  • #35713 (Remove boost as a unit test runner by rustaceanrob)
  • #34132 (coins,dbwrapper: make database point-read failures fatal by l0rinc)
  • #29418 (rpc: provide per message stats for global traffic via new field in 'getnettotals' by vasild)
  • #27865 (wallet: Track no-longer-spendable TXOs separately by achow101)
  • #17783 (common: Disallow calling IsArgSet() on ALLOW_LIST options by ryanofsky)
  • #17580 (refactor: Add ALLOW_LIST flags and enforce usage in CheckArgFlags by ryanofsky)
  • #16545 (refactor: Implement missing error checking for ArgsManager flags by ryanofsky)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@l0rinc

l0rinc commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Concept ACK

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edede38

iwyu incorrectly suggests to remove the util/expected include

This looks like IWYU's "Automatic re-export: function return values" heuristics in action.

@maflcko
maflcko force-pushed the 2608-cpp23 branch 3 times, most recently from 6e970d2 to 450acb9 Compare August 24, 2026 14:55
MarcoFalke added 9 commits November 26, 2026 10:04
1) value() might be marked [[nodiscard]], so add the missing (void),
   where the value is ignored.

2) std::expected::value() must be able to throw
   std::bad_expected_access<E> if the expected contains an error. That
   requires copying the error type, which is not possible in this unit
   test that uses a non-copyable error type.

   Fix it by using the non-throwing value accessor.
@maflcko

maflcko commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

thx, took some and replied to the others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants