Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upgrade to C++20. Notes:
autocheckusesstd::result_of(deprecated in 17, removed in 20)—I replaced just the use of that since we seem to have a de-facto in-tree fork ofautocheck(e.g., we referencestellar::).fmt::formatrequires a either a compile-time constant first parameter in 20 or afmt::runtimecall.for
fmtto work on clang, it seems that we need to have a version starting from this commit. Otherwise, code like the following doesn't workSo, I bumped the versions of
fmtandspdlogFMT_STRINGwithout any template arguments no longer picks up the right overload, but the C++20 version seems to correctly do compile-time strings with out it, so I updatedLogging.hto reflect this. One alternative is using the following macro, but I think it's probably cleaner to just remove theFMT_STRINGusage inLogging.hxdrppneeds to get updated for two reasons.On its current master, we end up trying to build using C++14, but it should be at least 17. Bumping to 20 (or 17) we get some extra flags1
Because of the spaceship operator, at the very least, we need
operator<=>defined forxdr::pointersince it inherits fromstd::unique_ptrwhich defines<=>, meaning that without the overload, e.g.,std::vector<xdr::pointer<int>>comparisons no longer work properly (they go back to comparing by address instead of value).There is the
cxx20branch, but it doesn't have the most recent 5 commits from the master branch (which we rely on in core). Additionally, it seems to be somewhat buggy (e.g.,tests/marshal.ccdoesn't pass). So, for the purposes of this PR, I think it's probably easiest to just bump to 20 and addoperator<=>for xdr data types.Small change, but renamed the constructor in the header file for
ScopedLedgerEntrysinceScopedLedgerEntry<T>isn't technically valid since DR 2237 was adopted in C++20 (link).Footnotes
Due to a known issue: autoconf adds a flag to enable C++11 features since C++20 isn't fully backwards compatible. Unfortunately, the patch to fix this behavior is not in a released version of autoconf ↩