Closed dmitrykobets-msft closed 2 years ago
Out of curiosity, is there a specific issue that you're looking to fix with this?
@SloppyJaconda It appears that the C++20 feature support actually had compilation / syntax errors. This was hidden because C++20 was never part of the CI pipeline, so the tests were never run. So this PR fixes those errors and attempts to enable C++20 in the CI
The C++2020 features (
std::span
support) were not enabled in the CI. As a result, the code had compilation issues that were never caught. Furthermore, the compiler versions in the README did not match up to the compilers that were actually being tested. For instance, the minimum GCC version advertised is 8, but we are testing 7.5.0 instead. The precise versions we should be testing will be re-visited in a later PR. But for now, this PR simply updates the README to be accurate to what is currently being tested.Previously, the guard for the span tests was
__cplusplus >= 202002L
. Unfortunately, this does not work for all compilers. For instance, inGCC 10
, running with-std=c++20
will fail the above condition (__cplusplus
will still be at 2017), and yet__cpp_lib_span >= 202002L
will be true. But forGCC 9
andGCC 8
,__cplusplus
will still be at 2017 and__cpp_lib_span
is undefined (neither have<span>
support). In all cases above, the span tests will be silently skipped. To avoid this confusing / incorrect (in the case ofGCC 10
) behavior, make the span tests execute unconditionally if running in CI mode with C++20 enabled. If a compiler version does not support span, the C++20 version should be explicitly removed from its CI jobs.