Bug 261949 - www/qt5-webengine: Fix build with clang 14
Summary: www/qt5-webengine: Fix build with clang 14
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks: 261742
  Show dependency treegraph
 
Reported: 2022-02-14 17:05 UTC by Dimitry Andric
Modified: 2022-02-15 18:46 UTC (History)
1 user (show)

See Also:
adridg: maintainer-feedback+


Attachments
Fix build with clang 14 (2.52 KB, patch)
2022-02-14 17:05 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2022-02-14 17:05:13 UTC
During an exp-run for llvm 14 (see bug 261742), it turned out that www/qt5-webengine fails to build with clang 14:

In file included from gen/third_party/blink/renderer/platform/platform_jumbo_63.cc:8:
./../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:122:15: error: anonymous non-C-compatible type given name for linkage purposes by typedef declaration after its linkage was computed; add a tag name here to establish linkage prior to definition
typedef struct {
              ^
               UTextWithBuffer
./../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:123:3: note: type is not C-compatible due to this member declaration
  DISALLOW_NEW();
  ^~~~~~~~~~~~~~
../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/allocator/allocator.h:40:2: note: expanded from macro 'DISALLOW_NEW'
 public:                                                                      \
 ^~~~~~~
./../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:126:3: note: type is given name 'UTextWithBuffer' for linkage purposes by this typedef declaration
} UTextWithBuffer;
  ^

This is because the typedef isn't compatible with C++ as written. Instead of:

typedef struct { ... } UTextWithBuffer;

it should just be:

struct UTextWithBuffer { ... };
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-02-14 17:05:45 UTC
Created attachment 231818 [details]
Fix build with clang 14
Comment 2 Adriaan de Groot freebsd_committer freebsd_triage 2022-02-15 12:49:04 UTC
LGTM, go ahead and land it.
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-02-15 18:21:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0825e7bc64e47d87e1f1026cc80c933550f114f5

commit 0825e7bc64e47d87e1f1026cc80c933550f114f5
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-02-14 12:55:25 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-02-15 18:19:54 +0000

    www/qt5-webengine: fix build with clang 14

    Fixes compile error:

    In file included from gen/third_party/blink/renderer/platform/platform_jumbo_63.cc:8:
    ./../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:122:15: error: anonymous non-C-compatible type given name for linkage purposes by typedef declaration after its linkage was computed; add a tag name here to establish linkage prior to definition
    typedef struct {
                  ^
                   UTextWithBuffer
    ./../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:123:3: note: type is not C-compatible due to this member declaration
      DISALLOW_NEW();
      ^~~~~~~~~~~~~~
    ../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/blink/renderer/platform/wtf/allocator/allocator.h:40:2: note: expanded from macro 'DISALLOW_NEW'
     public:                                                                      \
     ^~~~~~~
    ./../../../../qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator_icu.cc:126:3: note: type is given name 'UTextWithBuffer' for linkage purposes by this typedef declaration
    } UTextWithBuffer;
      ^

    PR:             261949
    Approved by:    adridg (maintainer)
    MFH:            2022Q1

 ...rer_platform_text_text__break__iterator__icu.cc (new) | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)