RESOLVED WONTFIX 191057
[Win][MSVC] Add /Zc:__cplusplus to enable __cplusplus macro standard conformance mode
https://bugs.webkit.org/show_bug.cgi?id=191057
Summary [Win][MSVC] Add /Zc:__cplusplus to enable __cplusplus macro standard conforma...
Fujii Hironori
Reported 2018-10-29 22:08:49 PDT
[Win][MSVC] Add /Zc:__cplusplus to enable __cplusplus macro standard conformance mode MSVC now correctly reports __cplusplus | Visual C++ Team Blog https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/
Attachments
Patch (2.87 KB, patch)
2018-10-29 22:17 PDT, Fujii Hironori
Hironori.Fujii: review-
Fujii Hironori
Comment 1 2018-10-29 22:17:45 PDT
Ross Kirsling
Comment 2 2018-10-29 23:16:19 PDT
Comment on attachment 353357 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=353357&action=review Informal r+ -- seems great! Do you think there's a benefit to reducing _MSC_VER usage in a subsequent patch? > Source/WTF/wtf/StdLibExtras.h:530 > -#if (__cplusplus < 201703L || (defined(__GLIBCXX__) && !defined(_GLIBCXX_RELEASE))) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190023918) > +#if __cplusplus < 201703L || (defined(__GLIBCXX__) && !defined(_GLIBCXX_RELEASE)) Looks like there's another instance of _MSC_FULL_VER immediately before this—shouldn't we remove it there too?
Fujii Hironori
Comment 3 2018-10-29 23:46:36 PDT
(In reply to Ross Kirsling from comment #2) > Do you think there's a benefit to reducing _MSC_VER usage in a subsequent > patch? To be clarify at first. _MSC_VER and _MSC_FULL_VER are for the compiler version. __cplusplus and _MSVC_LANG are for the language version. _MSVC_LANG should be removed in favor of sane __cplusplus. The original code was using _MSC_FULL_VER. This seems a simple mistake. > > Source/WTF/wtf/StdLibExtras.h:530 > > -#if (__cplusplus < 201703L || (defined(__GLIBCXX__) && !defined(_GLIBCXX_RELEASE))) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190023918) > > +#if __cplusplus < 201703L || (defined(__GLIBCXX__) && !defined(_GLIBCXX_RELEASE)) > > Looks like there's another instance of _MSC_FULL_VER immediately before > this—shouldn't we remove it there too? Year, you are right. There is. And, I can remove it. But, this is not so simple. The reason I'm doing this task is I want to downgrade Windows port to C++14 based of webkit-dev discussion <https://lists.webkit.org/pipermail/webkit-dev/2018-September/030186.html>. Here are the condition. > #if __cplusplus < 201703L && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190023918) && !defined(__cpp_lib_logical_traits) I can remove the _MSC_FULL_VER check because Windows port is using C++17. But, if I change /std:c++17 to /std:c++14. Then following compilation error happens. > 1>------ Build started: Project: WTF (WTF\WTF), Configuration: Debug x64 ------ > 1>DecimalNumber.cpp > 1>c:\webkit\gb\source\wtf\wtf\stdlibextras.h(525): error C2953: 'std::conjunction': class template has already been defined > 1>c:\webkit\gb\source\wtf\wtf\stdlibextras.h(525): note: see declaration of 'std::conjunction' > 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\tuple(62): error C3203: 'conjunction': unspecialized class template can't be used as a template argument for template parameter '_Trait', expected a real type > 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\tuple(65): note: see reference to class template instantiation 'std::_Tuple_explicit_val0<true,std::tuple<_Types...>,_Srcs...>' being compiled > 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\type_traits(1364): error C2903: 'conjunction': symbol is neither a class template nor a function template > 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\type_traits(1364): note: see reference to variable template 'const bool conjunction_v<std::negation<std::is_pointer<std::default_delete<WTF::StringView::GraphemeClusters::Iterator::Impl> > >,std::is_default_constructible<std::default_delete<WTF::StringView::GraphemeClusters::Iterator::Impl> > >' being compiled > 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\type_traits(1364): error C2065: 'value': undeclared identifier > 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\type_traits(1364): error C2131: expression did not evaluate to a constant > 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\type_traits(1364): note: failure was caused by non-constant arguments or reference to a non-constant symbol > 1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.14.26428\include\type_traits(1364): note: see usage of 'value' > 1>Done building project "WTF.vcxproj" -- FAILED. > ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== std::conjunction should be defined after C++17. This looks a MSVC bug.
Fujii Hironori
Comment 4 2018-10-30 02:55:14 PDT
Oh, no. AppleWin EWS is red. > -- The C compiler identification is MSVC 19.11.25547.0 (...) > /cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/bin/MSBuild.exe /verbosity:minimal C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\WebKit.sln /t:build /p:Configuration=Release /p:Platform=Win32 /fl /flp:LogFile=C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\webkit_errors.log;ErrorsOnly /fl1 /flp1:LogFile=C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\webkit_warnings.log;WarningsOnly /maxcpucount:8 > Microsoft (R) Build Engine version 15.4.8.50001 for .NET Framework (...) > cl : Command line warning D9002: ignoring unknown option '/Zc:__cplusplus' [C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\Source\WTF\wtf\WTF.vcxproj]
Fujii Hironori
Comment 5 2024-06-06 01:08:34 PDT
We dropped MSVC support. Closed.
Note You need to log in before you can comment on or make changes to this bug.