Bug 233963

Summary: Start using C++20
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, cdumez, cmarcelo, darin, ddkilzer, dino, eric.carlson, ews-watchlist, gyuyoung.kim, hi, Hironori.Fujii, kbr, keith_miller, kondapallykalyan, mark.lam, msaboff, pangle, ryuan.choi, saam, sergio, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=234022
https://bugs.webkit.org/show_bug.cgi?id=234933
https://bugs.webkit.org/show_bug.cgi?id=195548
https://bugs.webkit.org/show_bug.cgi?id=234546
Bug Depends on: 233448, 234933, 234995    
Bug Blocks: 235018, 235023    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
WinCairo fix
none
Patch
none
Patch
none
Patch
none
char8_t
ews-feeder: commit-queue-
char8_t is not available on GCC 8
none
char8_t is not available on GCC 8
ews-feeder: commit-queue-
char8_t is not available on GCC 8
ews-feeder: commit-queue-
char8_t is not available on GCC 8
ews-feeder: commit-queue-
char8_t is not available on GCC 8
none
Patch none

Description Alex Christensen 2021-12-07 17:29:39 PST
Start using C++20
Comment 1 Alex Christensen 2021-12-07 17:30:09 PST
Created attachment 446264 [details]
Patch
Comment 2 Yusuke Suzuki 2021-12-07 18:24:09 PST
Can you separate code changes from C++20 compiler option change?
Also need to change the following things.

cmake/OptionsCommon.cmake (CMAKE_CXX_STANDARD)
bmalloc/libpas/CMakeLists.txt (CMAKE_CXX_STANDARD)
JavaScriptCore/shell/PlatformPlayStation.cmake
Comment 3 Alex Christensen 2021-12-07 20:05:02 PST
Totally.  This is just a preview of what it would take.
Comment 4 Alex Christensen 2021-12-09 17:15:12 PST
Created attachment 446640 [details]
Patch
Comment 5 EWS Watchlist 2021-12-09 17:17:01 PST
Note that there are important steps to take when updating ANGLE. See https://trac.webkit.org/wiki/UpdatingANGLE
Comment 6 Alex Christensen 2021-12-09 23:01:34 PST
Created attachment 446666 [details]
Patch
Comment 7 Alex Christensen 2021-12-10 09:52:00 PST
Created attachment 446745 [details]
Patch
Comment 8 Alex Christensen 2021-12-10 11:01:19 PST
Created attachment 446764 [details]
Patch
Comment 9 Radar WebKit Bug Importer 2021-12-14 17:30:23 PST
<rdar://problem/86498505>
Comment 10 Yusuke Suzuki 2021-12-17 14:08:42 PST
GCC builds are failing due to is_pod is deprecated.
Comment 11 Fujii Hironori 2021-12-21 13:26:01 PST
Created attachment 447747 [details]
WinCairo fix
Comment 12 Alex Christensen 2021-12-21 15:04:12 PST
Created attachment 447754 [details]
Patch
Comment 13 Darin Adler 2021-12-21 15:29:34 PST
Comment on attachment 447754 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=447754&action=review

> Source/WTF/wtf/VectorTraits.h:59
> +    struct VectorTraits : VectorTraitsBase<std::is_standard_layout<T>::value && std::is_trivial<T>::value, T> { };

Why not use is_standard_layout_v and is_trivial_v instead?

> Source/WebCore/platform/ios/wak/WebCoreThread.mm:248
> +#pragma clang diagnostic push
> +#pragma clang diagnostic ignored "-Wdeprecated-volatile"

Can we use IGNORE_CLANG_WARNINGS_BEGIN/END instead of direct use of the pragma?
Comment 14 Alex Christensen 2022-01-05 15:16:08 PST
Created attachment 448438 [details]
Patch
Comment 15 Darin Adler 2022-01-05 15:34:09 PST
Really looking forward to https://en.cppreference.com/w/cpp/language/default_comparisons
Comment 16 Alex Christensen 2022-01-05 17:30:12 PST
Created attachment 448456 [details]
Patch
Comment 17 Yusuke Suzuki 2022-01-06 01:52:19 PST
Created attachment 448471 [details]
char8_t
Comment 18 Yusuke Suzuki 2022-01-06 02:05:01 PST
Created attachment 448474 [details]
char8_t is not available on GCC 8
Comment 19 Yusuke Suzuki 2022-01-06 02:10:24 PST
Created attachment 448475 [details]
char8_t is not available on GCC 8
Comment 20 Yusuke Suzuki 2022-01-06 02:14:06 PST
Created attachment 448476 [details]
char8_t is not available on GCC 8
Comment 21 Yusuke Suzuki 2022-01-06 02:18:34 PST
Created attachment 448477 [details]
char8_t is not available on GCC 8
Comment 22 Yusuke Suzuki 2022-01-06 02:25:23 PST
Created attachment 448478 [details]
char8_t is not available on GCC 8
Comment 23 Yusuke Suzuki 2022-01-06 02:30:28 PST
Comment on attachment 448456 [details]
Patch

r=me with the attached char8_t fix :) (which makes EWS green)
Comment 24 Alex Christensen 2022-01-06 10:14:36 PST
r287698
Comment 25 Fujii Hironori 2022-01-06 13:26:01 PST
AppleWin EWS reported some test crashing. They are true-positive.
Filed: Bug 234933 – [AppleWin] Some fast/shadow-dom/fullscreen-in-* tests are crashing after r287698
Comment 26 Alex Christensen 2022-01-07 11:25:33 PST
Reverted in r287768 and r287770.  There is an internal header in pre-Monterey OSes that uses enums in ways that C++20 doesn't like.  Hopefully I can find a workaround...
Comment 27 Alex Christensen 2022-01-07 13:08:30 PST
Reopening to attach new patch.
Comment 28 Alex Christensen 2022-01-07 13:08:34 PST
Created attachment 448624 [details]
Patch
Comment 29 EWS 2022-01-10 11:17:30 PST
Committed r287848 (245897@main): <https://commits.webkit.org/245897@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448624 [details].
Comment 30 David Kilzer (:ddkilzer) 2022-01-20 08:14:49 PST
I wonder if either of these NS Visual C++ bugs were fixed as part of this effort:

Bug 195548: [MS Visual C++] Source incompatibility with C++20
<https://bugs.webkit.org/show_bug.cgi?id=195548>

Bug 234546: MSVC reports "SVGPropertyAnimator.h(94): error C2839: invalid return type 'T *' for overloaded 'operator ->'" with /std:c++20
<https://bugs.webkit.org/show_bug.cgi?id=234546>