Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-99191: Use correct check for MSVC C++ version support in _wmimodule.cpp #100381

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

CAM-Gerlach
Copy link
Member

@CAM-Gerlach CAM-Gerlach commented Dec 20, 2022

As discussed in #99191 , in PC/_wmimodule.cpp it currently uses the check #if _MSC_VER >= 1929 to determine if the compiler supports C++20 designated initializers. However, the /std:c++20 flag was only introduced in VS 2019 16.11, but 1929 is also the version reported in VS 2019 16.10, which doesn't support that flag. Therefore, the current check will break (resulting in the unsupported C++20 branch being taken and presumably resulting in a compiler error) on VS 16.10 and also if the build is invoked such that \std:c++20 is overridden or not passed.

However, we can instead use _MSVC_LANG >= 202002L to check whether C++20 or greater is actually being targeted.

Fixes #99191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 awaiting review build The build process and cross-build OS-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/std:c++20 instead of /std:c++17 used for _wmimodule.cpp, but seems unnecessary
2 participants