Skip to content

Commit fa67f09

Browse files
author
MarcoFalke
committed
build: Require C++20 compiler
1 parent dce1dfb commit fa67f09

File tree

7 files changed

+8
-18
lines changed

7 files changed

+8
-18
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ jobs:
6262
echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD ^$(git rev-list -n1 --merges HEAD)^@ | head -1)" >> "$GITHUB_ENV"
6363
- run: |
6464
sudo apt-get update
65-
sudo apt-get install clang ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
65+
sudo apt-get install clang-15 ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y
6666
- name: Compile and run tests
6767
run: |
6868
# Run tests on commits after the last merge commit and before the PR head commit
6969
# Use clang++, because it is a bit faster and uses less memory than g++
70-
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang CXX=clang++ ./configure && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
70+
git rebase --exec "echo Running test-one-commit on \$( git log -1 ) && ./autogen.sh && CC=clang-15 CXX=clang++-15 ./configure && make clean && make -j $(nproc) check && ./test/functional/test_runner.py -j $(( $(nproc) * 2 ))" ${{ env.TEST_BASE }}
7171
7272
macos-native-x86_64:
7373
name: 'macOS 13 native, x86_64, no depends, sqlite only, gui'

build-aux/m4/ax_cxx_compile_stdcxx.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[
983983
984984
#error "This is not a C++ compiler"
985985
986-
#elif __cplusplus < 202002L
986+
#elif __cplusplus < 201709L // Temporary patch on top of upstream to allow g++-10
987987
988988
#error "This is not a C++20 compiler"
989989

configure.ac

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,8 @@ case $host in
9696
;;
9797
esac
9898

99-
AC_ARG_ENABLE([c++20],
100-
[AS_HELP_STRING([--enable-c++20],
101-
[enable compilation in c++20 mode (disabled by default)])],
102-
[use_cxx20=$enableval],
103-
[use_cxx20=no])
104-
105-
dnl Require C++17 compiler (no GNU extensions)
106-
if test "$use_cxx20" = "no"; then
107-
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
108-
else
99+
dnl Require C++20 compiler (no GNU extensions)
109100
AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory])
110-
fi
111101

112102
dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures
113103
dnl that we get the same -std flags for both.

depends/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ NO_HARDEN ?=
4949
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
5050

5151
C_STANDARD ?= c11
52-
CXX_STANDARD ?= c++17
52+
CXX_STANDARD ?= c++20
5353

5454
BUILD = $(shell ./config.guess)
5555
HOST ?= $(BUILD)

depends/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The following can be set when running make: `make FOO=bar`
9898
- `SDK_PATH`: Path where SDKs can be found (used by macOS)
9999
- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up
100100
- `C_STANDARD`: Set the C standard version used. Defaults to `c11`.
101-
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++17`.
101+
- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++20`.
102102
- `NO_BOOST`: Don't download/build/cache Boost
103103
- `NO_LIBEVENT`: Don't download/build/cache Libevent
104104
- `NO_QT`: Don't download/build/cache Qt and its dependencies

depends/packages/qt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $(package)_config_opts_release += -silent
4141
$(package)_config_opts_debug = -debug
4242
$(package)_config_opts_debug += -optimized-tools
4343
$(package)_config_opts += -bindir $(build_prefix)/bin
44-
$(package)_config_opts += -c++std c++17
44+
$(package)_config_opts += -c++std c++2a
4545
$(package)_config_opts += -confirm-license
4646
$(package)_config_opts += -hostprefix $(build_prefix)
4747
$(package)_config_opts += -no-compile-examples

src/.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ SpacesInAngles: false
4343
SpacesInContainerLiterals: true
4444
SpacesInCStyleCastParentheses: false
4545
SpacesInParentheses: false
46-
Standard: c++17
46+
Standard: c++20
4747
UseTab: Never

0 commit comments

Comments
 (0)