Now that MSVC (with /std:c++latest) supports import std; it's possible to remove the Microsoft-only experimental import std.core; etc lines from cpp2util.h and replace them with import std; or import std.compat;.
As described in #943, the import std.core; code was not working in the GitHub-hosted CI runner, so the MSVC regression tests have been updated to run cppfront with -include-std to #include headers instead of importing any modules.
I experimented with import std; and GitHub-hosted runners and documented two methods to get them building correctly:
- running
msbuild for a Visual Studio solution
- using
cl.exe in a shell, which is applicable for cppfront's GitHub CI workflow
https://github.com/bluetarpmedia/msvc-import-std-github
So this suggestion involves 2 changes:
- Update
cpp2util.h to use import std; (where available)
- Update the GitHub CI workflow to restore the default
-import-std behaviour, and modify the MSVC build job to compile import std; modules support first before then compiling the tests (more info in my msvc-import-std-github repo)