Bug 195548

Summary: MS Visual C++ source incompatibility with C++20
Product: WebKit Reporter: QuellaZhang <1998zhangyi>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ap, ddkilzer, Hironori.Fujii, jfbastien, lmoura, pvollan, sabouhallawa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.webkit.org/show_bug.cgi?id=233963
Bug Depends on: 235023    
Bug Blocks:    
Attachments:
Description Flags
p1008r1.pdf none

Description QuellaZhang 2019-03-11 03:10:00 PDT
Created attachment 364242 [details]
p1008r1.pdf

Hi all,

A paper(see attachment) voted into the C++20 working draft changes the definition of aggregate such that classes with any user-declared ctors are no longer aggregates. 

The MSVC team builds WebKit regularly to detect regressions, and found this failure under our build configuration with the /std:c++latest switch. Not sure if you are interented in upstreaming it if C++20 compatibility is on the library's radar. I still reported this issue. If not, we will try "/std:c++17".

Repro steps:
1. git clone https://github.com/WebKit/webkit d:\WebKit\src
2. open a VS 2017 x86 command prompt as admin and browse to D:\Webkit
3. extra WebKitLibrary\win to D:\WebKit\src\WebKitLibraries\win
4. set path=C:\gnuwin32\bin;%path%
5. set _CL_=/std:c++latest
6. cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DCMAKE_BUILD_TYPE=Release -DRUBY_LIBRARY=C:\Ruby25-x64\lib -DPORT="AppleWin" ..\src
7. msbuild /p:Configuration=Release;Platform=Win32 WebKit.sln /t:Rebuild

Failures:
D:\WebKit\build_x86\DerivedSources\ForwardingHeaders\pal/spi/cf/CFNetworkSPI.h(26): warning C4068: unknown pragma
D:\WebKit\src\Source\WebCore\html/canvas/CanvasStyle.cpp(93): error C2440: 'initializing': cannot convert from 'initializer list' to 'WebCore::CanvasStyle::CMYKAColor'
D:\WebKit\src\Source\WebCore\html/canvas/CanvasStyle.cpp(93): note: No constructor could take the source type, or constructor overload resolution was ambiguous

D:\WebKit\src\Source\WebCore\svg/SVGComponentTransferFunctionElement.cpp(113): error C2440: 'return': cannot convert from 'initializer list' to 'WebCore::ComponentTransferFunction'
D:\WebKit\src\Source\WebCore\svg/SVGComponentTransferFunctionElement.cpp(121): note: No constructor could take the source type, or constructor overload resolution was ambiguous
Comment 1 Fujii Hironori 2019-03-11 22:17:00 PDT
WebKit is using and supporting only C++14 at the moment.
It seems this is a trivial fix and can be compatible with C++14. I think it is acceptable if you submit a proposed patch if you want to keep C++20 compil-ability.
Comment 2 QuellaZhang 2019-03-19 01:48:18 PDT
Sorry for the late. We have applied patches for WebKit to support /std:c++latest. Once WebKit is clean in our testing, I will add a comment on this issue.
Comment 3 QuellaZhang 2019-03-24 23:06:12 PDT
Unfortunately, there is still error C2440 in the later build, not sure if there will be more. Since C++20 raises at least 3 errors C2440, internal discussion, we will go back to using C++17. Please close this issue, thank you.
Comment 4 Fujii Hironori 2021-01-18 12:19:02 PST
WebKit is using and supporting only C++17 at the moment.

https://webkit.org/languages/
https://trac.webkit.org/wiki/WebKitGTK/GCCRequirement

It seems this is a trivial fix and can be compatible with C++17. I think it is acceptable if you submit a proposed patch and if you want to keep WebKit to be compiled in C++20.
Comment 5 David Kilzer (:ddkilzer) 2022-01-17 10:17:02 PST
Cc Lauro FYI since he just landed a fix for Bug 235023.
Comment 6 Fujii Hironori 2022-02-03 11:49:43 PST
WebKit has migrated to C++20. I don't see these errors. Closed.

Bug 233963 – Start using C++20
Bug 233448 – [CMake][MSVC] Compile with /permissive-
Comment 7 Radar WebKit Bug Importer 2022-02-04 12:54:17 PST
<rdar://problem/88503617>