-
Notifications
You must be signed in to change notification settings - Fork 5k
Proposal: Upgrade C++ compiler feature level to C++ 17 #112419
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
Comments
We are also limited by the features of the target rootfs's stdlib, which may be quite out of date (I'm not sure the feature set of the libstdc++ in Ubuntu 18.04). Although given our current guidance, that does only matter for testing code since we recommend against heavy STL usage in product code. |
Is there anything else we'd benefit from? I think the proposal should include a strong motivation "why" |
The major benefit should be code simplification, plus some opportunity for taking compiler optimization. I was initially initiated by checking |
RHEL / CentOS StreamOn RHEL (and CentOS Stream) we also use clang to build .NET. Here are the default versions of clang in each:
These are new enough that they should support everything .NET needs from C++ 17 Fedora
These are new enough that they should support everything .NET needs from C++ 17 |
I personally don't see any reason not to move forward in this case.
We should be careful here. The C++ in this code base should be simple. We're not looking to adopt most modern C++ features. There are some APIs that we could benefit from, but they are narrow in scope. An example of a beneficial win from keeping more current would be adoption of the gsl libraries, it only requires C++ 14 which we use in some cases already. Specific benefits from C++17 itself are things like the Keeping as current as possible is a good goal, but it should be in service of staying current and modern rather than grabbing newer C++ features. This is a just a priority thing. |
I've just bumped into a case today that would benefit from moving to C++17 too. The |
The coreclr codebase has been using C++ 11 for a long time. Adopting C++ 17 features can help simplifying some code, for example message-less
static_assert
, or usage offilesystem
in non-clr testing code.It would require all supported configurations to have C++ 17 compatible compiler. Since we have upgraded the CMake requirement to 3.20 which was released in March 2021, it's unlikely to see an environment to have CMake 3.20 but no C++ 17 compiler.
On Windows and Apple OSes we are using latest compilers so there should be less concern. According to https://en.cppreference.com/w/cpp/compiler_support/17 , all C++ 17 language features are supported since GCC 7. RHEL 8 includes GCC 8.x. I couldn't figure out the GCC version included in all distros, but it seems that all our supported distros are having higher GCC version.
/cc @jkoritzinsky @dotnet/distro-maintainers Any comment or blocker on this?
The text was updated successfully, but these errors were encountered: