From 472ef3217946599ea650b33fb92dfd6fe03281b8 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Tue, 20 Dec 2022 17:50:30 -0500 Subject: [PATCH 1/2] Use correct check for MSVC C++ version support in _wmimodule.cpp --- PC/_wmimodule.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PC/_wmimodule.cpp b/PC/_wmimodule.cpp index de22049dd33f34..310aa86d94d9b6 100644 --- a/PC/_wmimodule.cpp +++ b/PC/_wmimodule.cpp @@ -17,7 +17,7 @@ #include -#if _MSC_VER >= 1929 +#if _MSVC_LANG >= 202002L // We can use clinic directly when the C++ compiler supports C++20 #include "clinic/_wmimodule.cpp.h" #else @@ -96,9 +96,9 @@ _query_thread(LPVOID param) } if (SUCCEEDED(hr)) { hr = services->ExecQuery( - bstr_t("WQL"), + bstr_t("WQL"), bstrQuery, - WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, + WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &enumerator ); From 6b33a99e2114fb7e71fd3e73b9b640658a529961 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Tue, 20 Dec 2022 18:37:56 -0500 Subject: [PATCH 2/2] Add NEWS entry for MSVC C++20 check change --- .../next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst diff --git a/Misc/NEWS.d/next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst b/Misc/NEWS.d/next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst new file mode 100644 index 00000000000000..57a95ab3ffcd5c --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst @@ -0,0 +1,2 @@ +Use ``_MSVC_LANG >= 202002L`` instead of less-precise ``_MSC_VER >=1929`` +to more accurately test for C++20 support in :file:`PC/_wmimodule.cpp`.