Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2024 07:11:53 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 281431] www/qt5-webengine: fix build with clang and libc++ 19
Message-ID:  <bug-281431-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281431

            Bug ID: 281431
           Summary: www/qt5-webengine: fix build with clang and libc++ 19
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: kde@FreeBSD.org
          Reporter: dim@FreeBSD.org
          Assignee: kde@FreeBSD.org
             Flags: maintainer-feedback?(kde@FreeBSD.org)

As noted in the libc++ 19 release notes [1], std::char_traits<> is now
only provided for char, char8_t, char16_t, char32_t and wchar_t, and any
instantiation for other types will fail.

This causes www/qt5-webengine to fail to compile with clang 19 and
libc++ 19, resulting in errors similar to:

  /usr/include/c++/v1/string:820:42: error: implicit instantiation of undef=
ined
template 'std::char_traits<unsigned short>'
    820 |   static_assert(is_same<_CharT, typename
traits_type::char_type>::value,
        |                                          ^
=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/v8/src/inspecto=
r/v8-string-conversions.cc:390:26:
note: in instantiation of template class 'std::basic_string<unsigned short>'
requested here
    390 | std::basic_string<UChar> UTF8ToUTF16(const char* stringStart, siz=
e_t
length) {
        |                          ^
  /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
     23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
        |                             ^

Upstream v8 has fixed this in commit 182d9c05e78 [2], so add it as a
backported patch, until the next version of qt5-webengine is released.

Also, clang 19 now implements CWG 96 [1], which requires a template
argument list after a 'template' keyword, resulting in errors similar
to:

=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/bli=
nk/renderer/platform/wtf/hash_table.h:1789:23:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
   1789 |   Allocator::template BackingWriteBarrier(&table_);
        |                       ^
=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/bli=
nk/renderer/platform/wtf/hash_table.h:1847:23:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
   1847 |   Allocator::template BackingWriteBarrier(&table_);
        |                       ^
=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/bli=
nk/renderer/platform/wtf/hash_table.h:2015:23:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
   2015 |   Allocator::template BackingWriteBarrier(&table_);
        |                       ^
=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/bli=
nk/renderer/platform/wtf/hash_table.h:2016:23:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
   2016 |   Allocator::template BackingWriteBarrier(&other.table_);
        |                       ^

and:

=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/per=
fetto/include/perfetto/tracing/internal/track_event_data_source.h:110:20:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
    110 |     Base::template Trace([](typename Base::TraceContext ctx) {
ctx.Flush(); });
        |                    ^
=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/per=
fetto/include/perfetto/tracing/internal/track_event_data_source.h:124:20:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
    124 |     Base::template Trace([&](typename Base::TraceContext ctx) {
        |                    ^
=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/per=
fetto/include/perfetto/tracing/internal/track_event_data_source.h:431:20:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
    431 |     Base::template Trace([&](typename Base::TraceContext ctx) {
        |                    ^
=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/per=
fetto/include/perfetto/tracing/internal/track_event_data_source.h:548:22:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
    548 |       Base::template TraceWithInstances(instances,
std::move(lambda));
        |                      ^
=20
../../../../kde-qtwebengine-5.15.17p3/src/3rdparty/chromium/third_party/per=
fetto/include/perfetto/tracing/internal/track_event_data_source.h:563:20:
error: a template argument list is expected after a name prefixed by the
template keyword [-Wmissing-template-arg-list-after-template-kw]
    563 |     Base::template Trace([&](typename Base::TraceContext ctx) {
        |                    ^

In case of wtf, appending "<>" is enough to satisfy the constraint. For
perfetto, this was fixed by upstream commit e2f661907a [3].

[1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals
[2] https://chromium.googlesource.com/v8/v8.git/+/182d9c05e78
[3] https://android.googlesource.com/platform/external/perfetto/+/e2f661907a

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-281431-7788>