Summary: | [WPE] Workaround for incorrect template specialization being selected when UChar=char16_t | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Charlie Turner <cturner> | ||||||
Component: | WPE WebKit | Assignee: | Charlie Turner <cturner> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bugs-noreply, commit-queue, mcatanzaro, webkit-bug-importer | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=193101 | ||||||||
Attachments: |
|
Description
Charlie Turner
2019-01-10 12:46:18 PST
Created attachment 358821 [details]
Patch
Temporary fix for bad template deducation when ICU switched to the UChar=char16_t typedef. With this definition, the specliazation for Signed && Integral wins over the typedef for UChar
Comment on attachment 358821 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=358821&action=review > Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:88 > -#if PLATFORM(WIN) > +#if PLATFORM(WIN) || U_ICU_VERSION_MAJOR_NUM >= 59 > EXPECT_EQ("hello 42 world", makeString("hello ", static_cast<unsigned short>(42) , " world")); > #else > EXPECT_EQ("hello * world", makeString("hello ", static_cast<unsigned short>(42) , " world")); // Treated as a character. I wonder how many bugs this behavior difference is causing. This is really unfortunate. :/ I almost gave this r-, but the new version is better and the old approach will be obsoleted eventually. Can we remove the #if PLATFORM(WIN), though? Surely that is there because they were using newer ICU? (In reply to Michael Catanzaro from comment #2) > I almost gave this r-, but the new version is better and the old approach > will be obsoleted eventually. Can we remove the #if PLATFORM(WIN), though? > Surely that is there because they were using newer ICU? IIUC, Windows hits the problem for a different reason, not sure if they use ICU, but on that platform UChar=wchar_t rather than unsigned short as assumed in this test. Let's continue discussion of how to fix the footgun here in bug #193101. Created attachment 359023 [details]
Patch for landing
Comment on attachment 359023 [details] Patch for landing Clearing flags on attachment: 359023 Committed r239920: <https://trac.webkit.org/changeset/239920> All reviewed patches have been landed. Closing bug. |