I have been able to compile C++ 17 sample code with LLVM 16.0.5 and 17.0.1 in the VS2010 IDE.
After installing LLVM and selecting the LLVM v100 toolchain from the project properties, I had to do the following things to make it work:
-first, the VC++ 2010 and Windows 7 SDK headers were freaking out at the C++17 syntax. So I took the headers from VC++ 2022 as well as the Windows 11 SDK's UCRT headers and placed them in "Additional Include Directories".
-Then, I went to the LLVM section of project properties and added the following compiler options: ``-Wc++17-extensions `` and ``-fms-compatibility-version=19``. This enables support for C++17 and allows the use of the built-in types that the new headers expect.
-Linking is complicated. The LLD linker cannot be used due to various issues so we must use the VC++ 2010 linker. This works to an extent, but there will usually be missing functions that the linker is unable to resolve. I built libs containing various functions such as __std_terminate,and a delete operator, which should be placed in "Linker -> Input -> Additional Dependencies" (https://github.com/win32ss/win32ss.github.io/raw/main/images/msvcrt10_cpp17_x64.lib and https://github.com/win32ss/win32ss.github.io/raw/main/images/msvcrt10_cpp17_x86.lib).
-Furthermore, if you are using msvcrt*, the VC++ 2010-supplied msvcrt.lib has baked-in directives that block it from being used where _MSC_VER is not equal to 1600. Clang will make it 1900 when -fms-compatibility-version is set to 19. This means that the directives must be patched; by opening up msvrt.lib in a hex editor, searching for all instances of /FAILIFMISMATCH:"_MSC_VER=1600" and changing 1600 to 1900 (zeroing-out the whole string may also work).
*newer ucrt libs were attempted, but there were issues with the linker not recognizing CFG. This would require rebuilding the runtime to remove CFG references.