4 ms·
Except MSVC is far ahead of Clang[1] (and leagues ahead of Apple Clang) when it comes to C++ standards conformance. 1. https://en.cppreference.com/w/cpp/compil
by frutiger 4y ago
Except MSVC is far ahead of Clang[1] (and leagues ahead of Apple Clang) when it comes to C++ standards conformance.
1. https://en.cppreference.com/w/cpp/compiler_support#cpp20 https://en.cppreference.com/w/cpp/compiler_support#cpp20
- xvilka 4y agoIt absolutely worse in pure C standards and library support though.
- hvs 4y agoUntil recently Microsoft didn't even pretend to support C, they basically just built a C++ compiler. But they have really stepped up their support in the past couple years: https://learn.microsoft.com/en-us/cpp/overview/install-c17-support?view=msvc-170 https://learn.microsoft.com/en-us/cpp/overview/install-c17-s...
- jcelerier 4y agoin theory yes, in practice this morning again I tried the new version of VS and encountered dozens and dozens of compile errors in standards-confirming C++20 code (which works fine in gcc and clang), some for fairly basic C++20 stuff.
- swatcoder 4y agoThis might not be your issue, but if you haven’t tried that transition before, the first batch of errors is often because secondary header includes incidentally let your code work in those other toolchains despite you not including required headers yourself. It happens annoyingly often, but it’s not a flaw in the toolchain. The MS headers are just structured differently.
- jcelerier 4y agoNo, those were actual language issues, not missing headers or things like that. For instance: https://developercommunity.visualstudio.com/t/if-constexprrequires----in-a-lamb/10293106 https://developercommunity.visualstudio.com/t/if-constexprre... Which is extremely frustrating when i reported a very similar issue in 17.4 which was reported as fixed (https://developercommunity.visualstudio.com/t/if-constexprrequires----broken-in/10162506 https://developercommunity.visualstudio.com/t/if-constexprre...), etc. I try building my code every once in a while against MSVC because it has some useful warnings but am very burn out with code breaking on almost every minor version - I shifted all my serious work to clang+libc++ on windows a few years ago already. E.g. I've reported something like 50+ bugs, internal compiler errors, etc... to MS over the years and only a couple for clang even though I use it much much more.
- Kranar 4y agoMSVC tends to like to tick off checkmarks that the other compilers would be hesitant to check off. So yes, MSVC can claim to implement modules and co-routines and pretty much all of the standard library, but in actuality it does so in a way that is unreliable and full of bugs. GCC and clang have those same features, but they avoid including them in their main distribution and instead have experimental/development forks that people can use, opting to include them only when they meet a much higher standard than Microsoft.
- simplotek 4y ago> Except MSVC is far ahead of Clang[1] (and leagues ahead of Apple Clang) when it comes to C++ standards conformance. I feel this is a red herring. People use AppleClang because it ships with Xcode and is integrated with it. Those who are stuck with Xcode will not choose msvc's support for C++20 as a good enough reason to drop everything. With Clang, the main differences with MSVC boil down to a couple of minor features that are hardly showstoppers, such as simplifying implicit lambda captures. Between being able to use clang and all it's tooling and being stuck with msvc, using clang is far above in importance.