Bug 247226 - [MSVC] constexpr-if statement in ArgumentCoders.h causes compilation errors
Summary: [MSVC] constexpr-if statement in ArgumentCoders.h causes compilation errors
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-10-29 04:21 PDT by Zan Dobersek
Modified: 2022-11-05 04:22 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2022-10-29 04:21:47 PDT
After 255496@main a compilation issue was reported on MSVC++:

> something.cpp(whatever-line-is-end-of-file): fatal error C1024: unexpected end-of-file found

Daniel narrowed this down to the listed change, and also narrowed down the problem to the constexpr-if introduced in the patch:

> if constexpr (Index < sizeof...(Elements)) { ...

What reportedly does work as intended is moving the calculation of the condition into a separate constexpr variable:

>  constexpr bool Recurse = (Index < sizeof...(Elements));

:shrug:
Comment 1 Fujii Hironori 2022-10-29 04:53:00 PDT
This looks like dup of bug#246506.
Comment 2 Daniel Kolesa 2022-10-29 05:05:35 PDT
looks like a dupe of that, yeah

there is actually a second instance of the error as well, introduced with https://github.com/WebKit/WebKit/commit/227096eba1370f2212bbfd7146580392846b1c7d#diff-92c56ce66bb066fa2340e34258930e3f33b5742330cfc3e460426d0df25cee3a
Comment 3 Daniel Kolesa 2022-10-29 05:06:41 PDT
are we interested in working around this in webkit, or just expect everyone to update their compiler?
Comment 4 Fujii Hironori 2022-10-29 05:51:29 PDT
MSVC already fixed the compiler bug. And, all upstream Windows bots are using VS2022. I think the workaround shouldn't be upstream and everyone should update VS.
Comment 5 Daniel Kolesa 2022-10-31 08:16:58 PDT
sgtm, let's do that then
Comment 6 Radar WebKit Bug Importer 2022-11-05 04:22:17 PDT
<rdar://problem/101994278>