-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: Add --enable-c++20 option #24169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
You may or may not be interested in one of my PRs to dash that did this dashpay#4600 I was planning on doing the equivalent here, but didn't want to until we could merge #23340 which if I recall correctly is required to fix cxx20 builds |
Concept ACK |
Support for c++20 has now been merged into the |
ee0ff0f
to
fabb931
Compare
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
4433cf5
to
8293846
Compare
b4c9519
to
50c40d2
Compare
7f3fb74
to
4f64dd4
Compare
If you want to split the macro update off, happy to merge that earlier, given it's a mechanical change. |
Thx, done. (No code changes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK fab63ca. Thanks for the descriptions, I understand this much better now!
@theuni you might also be interested here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept and code-review ACK fab63ca 2️⃣ 0️⃣
Tested --enable-c++20
compilation with clang 11.1.0 (OpenBSD 7.0).
Concept ACK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say the two pull requests are mostly orthogonal. If one is merged before the other, the one merged second can drop the temporary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK fab63ca
I'd say the two pull requests are mostly orthogonal. If one is merged before the other, the one merged second can drop the temporary
-Wno
commit.
Agree.
…um-conversion warnings acd98ad qt: Avoid potential -Wdeprecated-enum-enum-conversion warning (Hennadii Stepanov) d8641f0 qt: Use human-readable strings in preference to hard-coded integers (Hennadii Stepanov) Pull request description: This PR is related to bitcoin/bitcoin#24169. It adjusts code in order to avoid `-Wdeprecated-enum-enum-conversion` warnings instead of disabling them. Could be tested with gcc 11.2. ACKs for top commit: MarcoFalke: Approach ACK acd98ad fanquake: untested ACK acd98ad - thanks. promag: Code review ACK acd98ad. Tree-SHA512: e8043d997d85f8dba0f37ca02f1c60eb756a1732cf76a75908b01eb2cf7a4c6d4aaf6007271a929c213de37a0c1d96bc25280f0ee9eca488f370904461222ede
Removed a commit. Should be trivial to re-ACK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK fa6bc3b
CI failure?
|
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
Without the changes, the file will fail to compile under C++20 because char8_t can not be converted to char implicitly.
This makes code that uses the helper less verbose. Moreover, this makes net_processing C++20 compliant. Otherwise, it would lead to a compile error (see below). C++20 disables aggregate initialization when any constructor is declared. See http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1008r1.pdf net_processing.cpp:1627:42: error: no matching constructor for initialization of 'CSerializedNetMsg' m_connman.PushMessage(pnode, CSerializedNetMsg{ser_cmpctblock.data, ser_cmpctblock.m_type}); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 999982b. Since last review was rebased, and enum-conversion change was dropped, and CSerializedNetMsg copy workaround was added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 999982b
Nice! Though macOS trips over a deprecation (warning), see #24682. |
This is for CI and devs only and doesn't change that C++17 is the standard we are currently using. The option
--enable-c++20
allows CI to check that the C++17 code in the repo is also valid C++20. (There are some cases where valid C++17 doesn't compile under C++20).Also, it allows developers to easily play with C++20 in the codebase.