Bug 234368 - Support passing an old-style enum to add(Hasher&, ...)
Summary: Support passing an old-style enum to add(Hasher&, ...)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-15 15:22 PST by Chris Dumez
Modified: 2021-12-15 17:20 PST (History)
5 users (show)

See Also:


Attachments
Patch (4.48 KB, patch)
2021-12-15 15:29 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-12-15 15:22:18 PST
Support passing an old-style enum to add(Hasher&, ...). Currently, it works for enum classes but leads to ambiguity errors with some compiler when passing a plain enum:
/Volumes/Data/worker/production-archive/build/build-Production/MacOSX.platform/WebKit_OpenSource.roots/Sources/WebKit/Source/WebCore/platform/network/ProtectionSpaceHash.h:40:9: error: call to 'add' is ambiguous
        add(hasher, protectionSpace.serverType());
In file included from /Volumes/Data/worker/production-archive/build/build-Production/MacOSX.platform/WebKit_OpenSource.roots/BuildRecords/WebCore_install/Symbols/BuiltProducts/DerivedSources/WebCore/unified-sources/UnifiedSource43-mm.mm:5:
In file included from ./platform/network/mac/CookieStorageMac.mm:30:
In file included from /Volumes/Data/worker/production-archive/build/build-Production/MacOSX.platform/WebKit_OpenSource.roots/Sources/WebKit/Source/WebCore/platform/network/NetworkStorageSession.h:28:
In file included from /Volumes/Data/worker/production-archive/build/build-Production/MacOSX.platform/WebKit_OpenSource.roots/Sources/WebKit/Source/WebCore/platform/network/CredentialStorage.h:29:
In file included from /Volumes/Data/worker/production-archive/build/build-Production/MacOSX.platform/WebKit_OpenSource.roots/Sources/WebKit/Source/WebCore/platform/network/ProtectionSpaceHash.h:30:
/Volumes/Data/worker/production-archive/build/build-Production/MacOSX.platform/WebKit_OpenSource.roots/SDKs/MacOSX11.5.Internal.sdk/usr/local/include/wtf/Hasher.h:34:148: note: candidate function [with UnsignedInteger = WebCore::ProtectionSpaceServerType]
template<typename UnsignedInteger> std::enable_if_t<std::is_unsigned<UnsignedInteger>::value && sizeof(UnsignedInteger) <= sizeof(uint32_t), void> add(Hasher&, UnsignedInteger);
/Volumes/Data/worker/production-archive/build/build-Production/MacOSX.platform/WebKit_OpenSource.roots/SDKs/MacOSX11.5.Internal.sdk/usr/local/include/wtf/Hasher.h:126:89: note: candidate function [with Enumeration = WebCore::ProtectionSpaceServerType]
template<typename Enumeration> std::enable_if_t<std::is_enum<Enumeration>::value, void> add(Hasher& hasher, Enumeration value)
Comment 1 Chris Dumez 2021-12-15 15:29:02 PST
Created attachment 447290 [details]
Patch
Comment 2 EWS 2021-12-15 17:19:22 PST
Committed r287120 (245304@main): <https://commits.webkit.org/245304@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447290 [details].
Comment 3 Radar WebKit Bug Importer 2021-12-15 17:20:17 PST
<rdar://problem/86550827>