See e.g. https://pkg-status.freebsd.org/beefy18/data/main-amd64-default/p7520ea4fbadd_sfd774e065c/logs/kdevelop-23.04.1_1.log In file included from /wrkdirs/usr/ports/devel/kdevelop/work/kdevelop-23.04.1/plugins/clang/codecompletion/completionhelper.cpp:9: /wrkdirs/usr/ports/devel/kdevelop/work/kdevelop-23.04.1/plugins/clang/codecompletion/../duchain/cursorkindtraits.h:217:7: error: integer value -1 is outside the valid range of values [0, 255] for the enumeration type 'CommonIntegralTypes' [-Wenum-constexpr-conversion] : static_cast<IntegralType::CommonIntegralTypes>(-1); ^
A possibly relevant merge request was started @ https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/462
I haven't tested whether Clang 16 builds KDevelop successfully with my fix. Would appreciate if someone else tested the linked merge request.
I can confirm that the patch in the MR fixes the build wit clang 16. Thanks for the quick fix!
Git commit ede1cf4ad6f945349060db9446c489e3fd34dec4 by Igor Kushnir. Committed on 07/07/2023 at 10:58. Pushed by igorkushnir into branch 'master'. Don't cast out-of-enum-range -1 to CommonIntegralTypes This fixes the following Clang 16 compilation error: kdevelop/plugins/clang/duchain/cursorkindtraits.h:217:7: error: integer value -1 is outside the valid range of values [0, 255] for the enumeration type 'CommonIntegralTypes' [-Wenum-constexpr-conversion] : static_cast<IntegralType::CommonIntegralTypes>(-1); Quote from https://github.com/llvm/llvm-project/issues/59036 : The -Wenum-constexpr-conversion warning was created to account for the fact that casting integers to enums outside of the valid range of the enum is UB in C++17. Constant expressions invoking UB lead to an ill-formed program. FIXED-IN: 5.12.230800 M +2 -1 kdevplatform/language/duchain/types/integraltype.h M +1 -1 plugins/clang/duchain/builder.cpp M +1 -1 plugins/clang/duchain/cursorkindtraits.h https://invent.kde.org/kdevelop/kdevelop/-/commit/ede1cf4ad6f945349060db9446c489e3fd34dec4
*** Bug 475458 has been marked as a duplicate of this bug. ***