Created attachment 381272 [details] compilation error Since r251226 (Bug 202105) Clang-cl 8 can't compile WinCairo trunk. > FAILED: Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/runtime/Options.cpp.obj > C:\PROGRA~1\LLVM\bin\clang-cl.exe (...) -c ..\..\Source\JavaScriptCore\runtime\Options.cpp > ..\..\Source\JavaScriptCore\runtime\Options.cpp(294,12): error: variables defined in a constexpr function must be initialized > size_t index; > ^ > ..\..\Source\JavaScriptCore\runtime\Options.cpp(317,25): error: no matching function for call to 'optionTypeSpecificIndex' > FOR_EACH_JSC_OPTION(DEFINE_OPTION_ACCESSORS) > ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ > ..\..\Source\JavaScriptCore\runtime/OptionsList.h(124,5): note: expanded from macro 'FOR_EACH_JSC_OPTION' > v(Bool, useKernTCSM, true, Normal, "Note: this needs to go before other options since they depend on this value.") \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ..\..\Source\JavaScriptCore\runtime\Options.cpp(311,49): note: expanded from macro 'DEFINE_OPTION_ACCESSORS' > return g_jscConfig.type##type_##Options[optionTypeSpecificIndex<OptionTypeID::type_, OptionID::name_>()]; \ > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ..\..\Source\JavaScriptCore\runtime\Options.cpp(292,18): note: candidate template ignored: substitution failure [with type = JSC::OptionTypeID::Bool, id = JSC::OptionID::useKernTCSM] > constexpr size_t optionTypeSpecificIndex() > ^
Created attachment 381277 [details] Patch
Comment on attachment 381277 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381277&action=review > Source/JavaScriptCore/ChangeLog:8 > + clang-cl reported a compilation error for MSVC bug workaournd code of optionTypeSpecificIndex. /workaournd/workaround/ > Source/JavaScriptCore/runtime/Options.cpp:294 > +#if COMPILER(CLANG) // for clang-cl Is both COMPILER(CLANG) and COMPILER(MSVC) true at the same time for MSVC with Clang backend? Note that this snippet of code is wrapped in a #if COMPILER(MSVC).
Comment on attachment 381277 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381277&action=review > Source/JavaScriptCore/runtime/Options.cpp:297 > size_t index; I wonder if we can just change this to "size_t index = 0;" and keep the "index = 0;" below as well. Would that appease both clang and the MSVC backend?
Comment on attachment 381277 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381277&action=review >> Source/JavaScriptCore/runtime/Options.cpp:294 >> +#if COMPILER(CLANG) // for clang-cl > > Is both COMPILER(CLANG) and COMPILER(MSVC) true at the same time for MSVC with Clang backend? Note that this snippet of code is wrapped in a #if COMPILER(MSVC). Yes. clang-cl compiles the almost same code path with MSVC. >> Source/JavaScriptCore/runtime/Options.cpp:297 >> size_t index; > > I wonder if we can just change this to "size_t index = 0;" and keep the "index = 0;" below as well. Would that appease both clang and the MSVC backend? Will try.
Created attachment 381281 [details] Patch
Committed r251276: <https://trac.webkit.org/changeset/251276>
<rdar://problem/56400312>