-
Couldn't load subscription status.
- Fork 736
Switch build to C++20 #4378
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
Switch build to C++20 #4378
Conversation
76774f0 to
e943fc2
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4378 +/- ##
==========================================
- Coverage 89.35% 89.34% -0.02%
==========================================
Files 260 260
Lines 17549 17310 -239
==========================================
- Hits 15681 15465 -216
+ Misses 1868 1845 -23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3fe9219 to
6b49987
Compare
|
Hey Jim, I haven't been able to follow this very closely, but I just wanted to let you know that I am really happy to see it progressing. It will be great to have this 😃 |
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.
The instructions need a tweak, almost there.
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.
Just a few changes. I will test the Windows build ASAP and see if it works.
76cf46f to
a2b9923
Compare
Instead of creating temporary `std::string`s and adding them to a buffer, make these functions take the destination buffer and add to it directly.
This also means that we now require MSVC 2022.
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.
LGTM, very solid @jimporter. The build is tested in Windows 11 Pro and it works with the Qt mismatch.
It's the same here as well. MSVC 2019 (latest from Chocolatey) appears to crash while attempting to compile sftp_utils.cpp (and bunch of other sftp-related files, too): It seems like it's going to be a hard requirement to switch to VS2022. I don't see any downsides to that since VS2026 is also just around the corner; it's a good time to upgrade. |
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.
LGTM, also ran the cli-tests on Win11 Pro, no issues.
Thanks for the initiative, @jimporter! This will enable us to modernize the codebase further.
The coverage regressions are all due to already uncovered code being touched by refactoring.
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.
Double-checked the coverage regressions to confirm that they were already uncovered before.
Wow, haven't seen an ICE from MSVC in a while. That takes me back! Glad to see it's all working under MSVC 2022 though. |

I've split this into several commits for fixing the various compilation failures when switching to C++20. The main issues were:
std::u8stringuses the newchar8_t, which is incompatible withchar, so I mostly switched over to usingstd::string/char(semantically, this should mean effectively "a string using who-knows-what encoding, but probably UTF-8"). Longer term, it might make sense to try and usestd::filesystem::pathas much as possible.fmt's format strings are now type-checked at compile time, which also revealed a few bugs, likeformatcalls missing arguments and some nested calls toformat.