RESOLVED FIXED 203142
[Clang][Windows] Options.cpp(317,25): error: no matching function for call to 'optionTypeSpecificIndex'
https://bugs.webkit.org/show_bug.cgi?id=203142
Summary [Clang][Windows] Options.cpp(317,25): error: no matching function for call to...
Fujii Hironori
Reported 2019-10-17 22:24:52 PDT
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() > ^
Attachments
compilation error (23.29 KB, text/plain)
2019-10-17 22:24 PDT, Fujii Hironori
no flags
Patch (1.83 KB, patch)
2019-10-17 23:12 PDT, Fujii Hironori
no flags
Patch (1.73 KB, patch)
2019-10-18 00:17 PDT, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2019-10-17 23:12:37 PDT
Mark Lam
Comment 2 2019-10-17 23:21:24 PDT
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).
Mark Lam
Comment 3 2019-10-17 23:24:26 PDT
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?
Fujii Hironori
Comment 4 2019-10-17 23:36:54 PDT
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.
Fujii Hironori
Comment 5 2019-10-18 00:17:17 PDT
Fujii Hironori
Comment 6 2019-10-18 01:30:24 PDT
Radar WebKit Bug Importer
Comment 7 2019-10-18 01:31:21 PDT
Note You need to log in before you can comment on or make changes to this bug.