In file included from DerivedSources/ForwardingHeaders/wtf/text/AtomString.h:26, from DerivedSources/ForwardingHeaders/wtf/text/StringBuilder.h:30, from ../../Tools/TestWebKitAPI/WTFStringUtilities.h:39, from ../../Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:28: DerivedSources/ForwardingHeaders/wtf/text/IntegerToStringConversion.h: In instantiation of ‘unsigned int WTF::lengthOfIntegerAsString(IntegerType) [with IntegerType = bool]’: DerivedSources/ForwardingHeaders/wtf/text/StringConcatenateNumbers.h:60:61: required from ‘unsigned int WTF::StringTypeAdapter<Enum, typename std::enable_if<is_enum_v<Enum>, void>::type>::length() const [with Enum = TestWebKitAPI::BoolEnum; typename std::enable_if<is_enum_v<Enum>, void>::type = void]’ DerivedSources/ForwardingHeaders/wtf/text/StringConcatenate.h:390:35: required from ‘WTF::String WTF::tryMakeStringFromAdapters(StringTypeAdapter, StringTypeAdapters ...) [with StringTypeAdapter = WTF::StringTypeAdapter<TestWebKitAPI::BoolEnum, void>; StringTypeAdapters = {}]’ DerivedSources/ForwardingHeaders/wtf/text/StringConcatenate.h:420:37: required from ‘WTF::String WTF::tryMakeString(StringTypes ...) [with StringTypes = {TestWebKitAPI::BoolEnum}]’ DerivedSources/ForwardingHeaders/wtf/text/StringConcatenate.h:426:34: required from ‘WTF::String WTF::makeString(StringTypes ...) [with StringTypes = {TestWebKitAPI::BoolEnum}]’ ../../Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp:111:5: required from here DerivedSources/ForwardingHeaders/wtf/text/IntegerToStringConversion.h:115:53: warning: parameter ‘integer’ set but not used [-Wunused-but-set-parameter] 115 | inline unsigned lengthOfIntegerAsString(IntegerType integer) | ~~~~~~~~~~~~^~~~~~~
Created attachment 406174 [details] Patch
Comment on attachment 406174 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406174&action=review Both lengthOfIntegerAsString() and another method were refactored to handle all types in a single method, so I'd prefer to keep them that way. > Source/WTF/wtf/text/IntegerToStringConversion.h:-119 > - if constexpr (std::is_same_v<IntegerType, bool>) > - return 1; I think we should add UNUSED_PARAM(integer) here instead.
(In reply to David Kilzer (:ddkilzer) from comment #2) > Comment on attachment 406174 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=406174&action=review > > Both lengthOfIntegerAsString() and another method were refactored to handle > all types in a single method, so I'd prefer to keep them that way. > > > Source/WTF/wtf/text/IntegerToStringConversion.h:-119 > > - if constexpr (std::is_same_v<IntegerType, bool>) > > - return 1; > > I think we should add UNUSED_PARAM(integer) here instead. Thank you for your review. I will add UNUSED_PARAM in the next patchset.
Created attachment 406237 [details] Patch
Created attachment 406239 [details] Patch
Committed r265407: <https://trac.webkit.org/changeset/265407>
<rdar://problem/66721962>