Summary: | cursorkindtraits.h fails to build with Clang 16 and C++17 | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Raphael Kubo da Costa <rakuco> |
Component: | Code completion | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | igorkuo, lg3dx6fd |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | All | ||
Latest Commit: | https://invent.kde.org/kdevelop/kdevelop/-/commit/ede1cf4ad6f945349060db9446c489e3fd34dec4 | Version Fixed In: | 5.12.230800 |
Description
Raphael Kubo da Costa
2023-07-06 08:47:05 UTC
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. *** |