Bug 235458 - Build failure with GCC 12: no matching function for call to 'end(LChar [7])'
Summary: Build failure with GCC 12: no matching function for call to 'end(LChar [7])'
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-21 15:18 PST by Michael Catanzaro
Modified: 2022-01-24 12:29 PST (History)
3 users (show)

See Also:


Attachments
Patch for landing (1.05 KB, patch)
2022-01-24 11:22 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2022-01-21 15:18:19 PST
Next challenge in attempting to build with GCC 12: something is wrong with IntegerToStringConversion.h, and it's unclear how to fix it. I'll need to try a few more things....

In file included from /builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/WTFString.h:30,
                 from /builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/URL.h:28,
                 from /builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/URL.cpp:28:
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/IntegerToStringConversion.h: In instantiation of 'void WTF::writeIntegerToBufferImpl(UnsignedIntegerType, CharacterType*) [with CharacterType = unsigned char; UnsignedIntegerType = short unsigned int; PositiveOrNegativeNumber NumberType = WTF::PositiveNumber]':
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/IntegerToStringConversion.h:95:84:   required from 'void WTF::writeIntegerToBuffer(IntegerType, CharacterType*) [with CharacterType = unsigned char; IntegerType = short unsigned int]'
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/StringConcatenateNumbers.h:45:74:   required from 'void WTF::StringTypeAdapter<Integer, typename std::enable_if<is_integral_v<CharacterType>, void>::type>::writeTo(CharacterType*) const [with CharacterType = unsigned char; Integer = short unsigned int; typename std::enable_if<is_integral_v<CharacterType>, void>::type = void]'
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/StringConcatenate.h:430:33:   recursively required from 'void WTF::stringTypeAdapterAccumulator(ResultType*, Adapter, Adapters ...) [with ResultType = unsigned char; Adapter = StringTypeAdapter<char, void>; Adapters = {StringTypeAdapter<short unsigned int, void>}]'
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/StringConcatenate.h:430:33:   required from 'void WTF::stringTypeAdapterAccumulator(ResultType*, Adapter, Adapters ...) [with ResultType = unsigned char; Adapter = StringTypeAdapter<StringView, void>; Adapters = {StringTypeAdapter<char, void>, StringTypeAdapter<short unsigned int, void>}]'
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/StringConcatenate.h:450:41:   required from 'WTF::String WTF::tryMakeStringFromAdapters(StringTypeAdapter, StringTypeAdapters ...) [with StringTypeAdapter = StringTypeAdapter<StringView, void>; StringTypeAdapters = {StringTypeAdapter<char, void>, StringTypeAdapter<short unsigned int, void>}]'
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/StringConcatenate.h:469:37:   required from 'WTF::String WTF::tryMakeString(StringTypes ...) [with StringTypes = {StringView, char, short unsigned int}]'
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/StringConcatenate.h:475:34:   required from 'WTF::String WTF::makeString(StringTypes ...) [with StringTypes = {StringView, char, short unsigned int}]'
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/URL.cpp:152:26:   required from here
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/IntegerToStringConversion.h:69:26: error: no matching function for call to 'end(LChar [7])'
   69 |     LChar* end = std::end(buf);
      |                  ~~~~~~~~^~~~~
In file included from /usr/include/c++/12/variant:36,
                 from /builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/StdLibExtras.h:32,
                 from /builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/FastMalloc.h:26,
                 from /builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/config.h:31,
                 from /builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/URL.cpp:27:
/usr/include/c++/12/initializer_list:101:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
  101 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/12/initializer_list:101:5: note:   template argument deduction/substitution failed:
/builddir/build/BUILD/webkitgtk-2.35.1/Source/WTF/wtf/text/IntegerToStringConversion.h:69:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'LChar*' {aka 'unsigned char*'}
   69 |     LChar* end = std::end(buf);
      |                  ~~~~~~~~^~~~~
Comment 1 Mike Gorse 2022-01-24 06:15:32 PST
I saw that, too, but only for 2.34.x. Including <string> fixes it there for me.
Comment 2 Michael Catanzaro 2022-01-24 09:14:13 PST
(In reply to Mike Gorse from comment #1)
> I saw that, too, but only for 2.34.x. Including <string> fixes it there for
> me.

Huh, wouldn't have guessed that. Thanks....
Comment 3 Michael Catanzaro 2022-01-24 10:53:49 PST
(In reply to Mike Gorse from comment #1)
> I saw that, too, but only for 2.34.x. Including <string> fixes it there for
> me.

That indeed allows me to build 2.35.1.

I will land this #include <string> anyway. Even if it's included from someplace else nowadays in trunk, it reduces the chance of trouble again in the future.
Comment 4 Michael Catanzaro 2022-01-24 11:22:27 PST
Created attachment 449833 [details]
Patch for landing
Comment 5 EWS 2022-01-24 12:29:30 PST
Committed r288460 (246346@main): <https://commits.webkit.org/246346@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449833 [details].