Sidenote:
MS support for Windows 7 did end already 2020-01-14, and even
Extended Security Updates (Win7 ESU, for subscribers) did end 2023-01-10.
Only some embedded versions remain in "not totally dead" category.
What "market" is there left for Windows 7 applications?
("Larger than Linux desktops combined" is still not huge achievement.)
Win 7 may no longer supported, but VS 2022 can create executables -- console mode and GUI -- for later Win versions other than just Win 7. It depends on the Win SDK used and WinAPI functions used.
My PCs are Win 10, yet I build my apps using the Win 11 WinAPI SDK. The current up-to-date WinAPI SDK. Not a single app I create fails to run on my machines. 32- or 64-bits.
Though I don't use Clang as my compiler front end, I use the default compiler VS provides, I'd hazard a guess something similar applies. One of the numerous contributors to Clang and LLVM is MS.
but VS 2022 can create executables -- console mode and GUI -- for later Win versions other than just Win 7. It depends on the Win SDK used and WinAPI functions used.
True - but without using the latest C++ features as these are only introduced with updates of VS.
IIRC all C++20 features should be available in that particular VS 2022 update, but of course C++23 and later compliance is gonna be a big fat nada. I run Win 10 with VS 2022's current latest version.
For that matter it looks like the latest Clang version is lacking full C++20 support also. No compiler suite is fully C++23 compliant yet.
I know of several local companies that still use Win 7 despite the lack of support. One company I know of still uses Win XP because a particular app they use requires it. The Win backwards compatibility feature doesn't work reliably.