-
Notifications
You must be signed in to change notification settings - Fork 38.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) |
ryanofsky
left a comment
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 fab63ca14298d37022e23d3e9747bc4bf94121c9. Thanks for the descriptions, I understand this much better now!
|
@theuni you might also be interested here |
theStack
left a comment
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 fab63ca14298d37022e23d3e9747bc4bf94121c9 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.
Approach ACK fab63ca14298d37022e23d3e9747bc4bf94121c9, except for the fa08f8b8cd4eb13cc5904d33e027f6c485b9f4b1 "Set -Wno-deprecated-enum-enum-conversion" commit. An alternative has been suggested in #24624.
|
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 |
hebasto
left a comment
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 fab63ca14298d37022e23d3e9747bc4bf94121c9
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
-Wnocommit.
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 fa6bc3b2ccb7386ed496dd8be6b748e95c28b957
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}); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ryanofsky
left a comment
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
fanquake
left a comment
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++20allows 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.