-
Notifications
You must be signed in to change notification settings - Fork 273
Use C++17 #6749
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
Use C++17 #6749
Conversation
I am in favour of moving to C++17. This will allow us to remove the library code which has been back ported C++11, which will reduce the maintenance needed. It would also support using |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #6749 +/- ##
===========================================
- Coverage 79.10% 79.07% -0.03%
===========================================
Files 1699 1694 -5
Lines 196508 196276 -232
===========================================
- Hits 155443 155204 -239
- Misses 41065 41072 +7 ☔ View full report in Codecov by Sentry. |
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.
In principle... OK. But:
- Are there any currently supported linux distros that don't have
g++ --version >= 7.0
? I don't think so but RedHat and derivatives do tend to ship surprisingly old versions of tools. - I am not seeing any changes to the CI set up. Is that because all of the tested platforms are already using a suitable version?
5f00f86
to
c4a7735
Compare
According to https://access.redhat.com/solutions/19458, only RHEL 8 has a version of GCC new enough to build current CBMC (which requires GCC 5), but then that new-enough version is GCC 8, so we should be fine. But perhaps @TGWDB has an idea whether there might be any other users who might be unable to use a new-enough version of GCC.
That's correct, no changes needed. |
c4a7735
to
58e085a
Compare
Feel free to create a PR against my branch so as to introduce the use of |
47b6b33
to
9ba2012
Compare
I'm not aware of Linux users who might have issues, but we need to make sure MSVC builds work. I believe as long as we have support for MSVC 2019 (currently tested in CI) we are ok. |
b03ffdb
to
7ad368d
Compare
dac9f4b
to
137c742
Compare
Add missing <functional> include [blocks: #6749]
CMake/macOS: upgrade minimum version to 10.15 [blocks: #6749]
137c742
to
6cea55c
Compare
Disambiguate overloaded insert(...) calls [blocks: #6749]
Remove unqualified use of nullopt [blocks: #6749]
Replace assert(...) by macros from invariant.h [blocks: #6749]
As already agreed this now depends on #7989 |
6cea55c
to
f153827
Compare
b1f2826
to
6b691bc
Compare
Removes third-party code that is no longer necessary now that we use C++ 17 as build standard. Future uses of optionalt should instead use std::optional directly.
6b691bc
to
84cf0a5
Compare
With the move to C++ 17 we can use std::make_unique instead.
With the move to C++ 17 we can use std::void_t instead.
With C++ 17 we can use the STL-provided implementation instead of rolling our own (platform-dependent) code.
Python warns about the use of `\d`: we should use raw strings here as that's not meant to be an escape sequence.
See https://github.com/diffblue/cbmc/actions/runs/6856483568/job/18643716705?pr=6749 for one example of the failure: cargo-induced clang runs (via the cc crate) weren't finding the C++ library (which ought to be libc++ and not libstdc++ on this MacOS target). This appears to be caused by the minimum build target being too low (where the cc crate is the one setting that minimum). Override that by setting an environment variable. See https://github.com/rust-lang/cc-rs/blob/2d6a3b2119cf5eacc01e1f2877e064a7aede7819/src/lib.rs#L3497C52-L3497C76 for the Rust code implementing the logic.
The prefix lookup resulted in picking up the Release-Glucose cache from check-macos-12-cmake-clang. This cache, however, was established with Glucose as a SAT solver, which implies different compiler command lines. Consequently, there would be 0 cache hits.
84cf0a5
to
6e1615c
Compare
Use C++17 now that it has become a build requirement.