See the whole build log here: https://pkg-status.freebsd.org/beefy18/data/main-amd64-default/p12211587418a_see8b0c436d/logs/kleopatra-23.04.2.log The actual error is src/accessibility/accessiblevaluelabel.cpp:21:48: error: integer value 65536 is outside the valid range of values [0, 65535] for the enumeration type 'Role' [-Wenum-constexpr-conversion] static constexpr QAccessible::Role ValueRole = static_cast<QAccessible::Role>(QAccessible::UserRole + 1); which comes from Clang 16 defaulting to using C++17 instead of C++14 and throwing a bunch of new errors on code that used to work.
Actually this is unrelated to C++17, it's just Clang 16 being stricter and pointing out invalid code (even if I manually make it build that file in C++14 mode, for example).
QAccessible::UserRole is documented as "The first value to be used for user defined roles.". Hence, we are supposed to use QAccessible::UserRole + n for user defined roles. I'm using QAccessible::UserRole + 1. Unfortunately, Qt chose 0x0000ffff as value for QAccessible::UserRole, so that all values of the QAccessible::Role enum fit into uint16 and apparently clang 16 chooses uint16 as underlying type (because the "underlying type is an implementation-defined integral type that can represent all enumerator values"). I consider this a bug in Qt. To me, Qt clearly intends QAccessible::Role as a 32-bit enum (apparent from the 32-bit hex notation used for the enum values) and therefore needs to state int (or unsigned int) explicitly as underlying type of QAccessible::Role: ``` enum Role { NoRole = 0x00000000, TitleBar = 0x00000001, MenuBar = 0x00000002, ``` https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/accessible/qaccessible_base.h This is related to bug https://bugreports.qt.io/browse/QTBUG-64962 which was closed as invalid without addressing the issue that compilers can choose smaller underlying types than (seemingly) intended by Qt.
Who's going to revive that upstream bug then?
It's on my todo list to open an upstream bug for this. The old bug was mainly about int vs. unsigned int. For now the fix is to patch enum Role { to enum Role : int { in src/gui/accessible/qaccessible_base.h of qtbase.
Upstream bug report for Qt: https://bugreports.qt.io/browse/QTBUG-117517