C++20 support - continue to use c++17 on files that use LLVM #1192
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.
LLVM headers prior to version 13.0 result in an error when compiling in c++20 mode.
Refactor EOS VM OC a wee bit to isolate LLVM headers to just a few .cpp files (and eliminate usage of "other stuff", like fc, from those same files), and compile those with c++17 still.
Compared to #1116, the positive with this change is that it retains compatibility with existing LLVM versions and doesn't get us in the business of patching system provided files which may cause some additional subtle headaches (do they need to be installed for libtester? do they cause an ODR violation?)
The negative is mainly that it's not clear how long lived this solution can be. For example, once we tackle #673, LLVM & EOS VM will be more tightly coupled. EOS VM doesn't use c++20 today, but it might in the future.
I don't particularly like using
COMPILE_FLAGS "--std=gnu++17"
but there is no source file property forCXX_STANDARD
; there is a target property forCXX_STANDARD
though, so a wee bit of clean up could possibly use that instead.