-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Upgrade to C++20 #7554
Upgrade to C++20 #7554
Conversation
Those implicit captures were deprecated in C++20
Unfortunately std::atomic<std::shared_ptr> (P0718R2) is not supported by GCC until GCC 12 and still is not supported by Clang or Apple Clang, so it looks like we will continue using std::atomic_load for the time being
There are still a few open comments about C++20:
Can some of them be solved, or are the compilers limiting us here? |
Yes, we'd need to upgrade our GCC 9.3 (and MinGW 9.3) compilers to at least GCC 10 to begin addressing some of those.
These will be possible with GCC 10.
This will be possible with GCC 11.
This will be possible with GCC 13. |
In
Files:
So, this PR adds new warnings on Linux, which might be unwanted, or strategy if you plan to keep them as TODO markers. |
There might be From the clang-tidy list , I see at least: |
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.
My review is positive, with 1 optional code comment, 2 optional conversation comments (see above).
What I checked:
- Functional review ✔️
- Style review ✔️
- Test review ✔️
Should be fixed now EDIT: I messed it up - the |
93ed53a (which you just pushed) compiles without warnings for me |
AnalyzeTemporaryDtors was deprecated in clang-tidy 16 and fully removed in clang-tidy 18
This has 2 reviews of developers, and all kinds of reviews are covered. No one else complained in the last 2 weeks. Is there any reason to prevent merging? |
Prevents issues if any enum flags in `args` have bits in common
After the rework, I now tested the key sequences - still working. |
* Compile in C++20 mode * Fix implicit lambda captures of `this` by `[=]` Those implicit captures were deprecated in C++20 * Silence MSVC atomic std::shared_ptr warning Unfortunately std::atomic<std::shared_ptr> (P0718R2) is not supported by GCC until GCC 12 and still is not supported by Clang or Apple Clang, so it looks like we will continue using std::atomic_load for the time being * Use C++20 in RemoteVstPlugin * Simplification * Add comment * Fix bitwise operations between different enumeration types * Revert "Fix bitwise operations between different enumeration types" This reverts commit d45792c. * Use a helper function to combine keys and modifiers * Remove AnalyzeTemporaryDtors from .clang-tidy AnalyzeTemporaryDtors was deprecated in clang-tidy 16 and fully removed in clang-tidy 18 * Use C++20 in .clang-format * Use bitwise OR Prevents issues if any enum flags in `args` have bits in common
This was a lot easier than I was expecting.
Our Linux and Windows MinGW builds are using GCC/MinGW 9.3 which will be the limiting factor here in terms of what we can do with C++20. They barely have any C++20 support, but even the small amount they do provide should be useful.
Some highlights of what we should have now:
char8_t
andstd::u8string
contains()
member function of associative containersThings we won't have yet:
std::span
std::format
But once we upgrade to GCC 10, we will have some of these big C++20 features.