diff --git a/devel/kdevelop/Makefile b/devel/kdevelop/Makefile index 3f168b889d72..4512811fa2b2 100644 --- a/devel/kdevelop/Makefile +++ b/devel/kdevelop/Makefile @@ -1,72 +1,65 @@ # When updating this port, also chase # devel/kdev-php # devel/kdev-python PORTNAME= kdevelop DISTVERSION= ${KDE_APPLICATIONS_VERSION} CATEGORIES= devel kde kde-applications MAINTAINER= kde@FreeBSD.org COMMENT= Plugin extensible IDE for C/C++ and other languages WWW= https://www.kdevelop.org/ LICENSE= GPLv2+ LGPL20+ LICENSE_COMB= multi BUILD_DEPENDS= kdev-pg-qt:devel/kdevelop-pg-qt LIB_DEPENDS= libKasten4Controllers.so:devel/okteta \ libapr-1.so:devel/apr1 \ libsvn_client-1.so:devel/subversion \ libboost_thread.so:devel/boost-libs \ libkomparediff2.so:textproc/libkomparediff2 RUN_DEPENDS= gmake:devel/gmake USES= cmake compiler:c++11-lib desktop-file-utils gettext grantlee:5 \ kde:5 llvm:build,run pkgconfig qt:5 shared-mime-info \ shebangfix tar:xz xorg USE_KDE= archive attica auth bookmarks codecs completion config \ configwidgets coreaddons crash emoticons guiaddons i18n \ iconthemes init itemmodels itemviews jobwidgets kcmutils \ kdeclarative kio libksysguard newstuff notifications \ notifyconfig package parts plasma-framework purpose runner \ service solid sonnet syntaxhighlighting texteditor textwidgets \ threadweaver widgetsaddons windowsystem xmlgui USE_QT= concurrent core dbus declarative gui help network printsupport \ script sql widgets xml \ buildtools:build qmake:build USE_XORG= x11 SHEBANG_FILES= kdevplatform/util/kdevplatform_shell_environment.sh \ kdevplatform/util/.zshrc # Most ports have ecm:build, testlib:build, but because this is an # IDE, which **probably** is used for Qt / KDE development (also # other things, but let's guess a target market), pull in some # additional development things that are otherwise build-dep-only. USE_KDE+= ecm USE_QT+= testlib CMAKE_ARGS= -DCMAKE_POLICY_DEFAULT_CMP0074=NEW \ -DClang_DIR=${LLVM_PREFIX}/lib/cmake/clang # Versioning values, to reduce plist churn SO_VER= 511 SO_VER_LONG= 5.11.230403 PLIST_SUB+= SO_VER=${SO_VER} SO_VER_LONG=${SO_VER_LONG} OPTIONS_DEFINE= WEBENGINE WEBENGINE_DESC= Use WebEngine as help reader WEBENGINE_USES= qt:5 WEBENGINE_USE= QT=location,webchannel,webengine WEBENGINE_USE_OFF= QT=webkit WEBENGINE_CMAKE_OFF= -DCMAKE_DISABLE_FIND_PACKAGE_Qt5WebEngineWidgets:BOOL=TRUE SHEBANG_LANG= zsh zsh_OLD_CMD= /bin/zsh zsh_CMD= ${LOCALBASE}/bin/zsh -.include - -.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160 -# Reported upstream: https://bugs.kde.org/show_bug.cgi?id=471995 -CXXFLAGS+= -Wno-error=enum-constexpr-conversion -.endif - -.include +.include diff --git a/devel/kdevelop/files/patch-git_ede1cf4ad6f945349060db9446c489e3fd34dec4 b/devel/kdevelop/files/patch-git_ede1cf4ad6f945349060db9446c489e3fd34dec4 new file mode 100644 index 000000000000..895038ad0952 --- /dev/null +++ b/devel/kdevelop/files/patch-git_ede1cf4ad6f945349060db9446c489e3fd34dec4 @@ -0,0 +1,66 @@ +From ede1cf4ad6f945349060db9446c489e3fd34dec4 Mon Sep 17 00:00:00 2001 +From: Igor Kushnir +Date: Fri, 7 Jul 2023 09:50:30 +0300 +Subject: [PATCH] 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(-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. + +BUG: 471995 +FIXED-IN: 5.12.230800 +--- + kdevplatform/language/duchain/types/integraltype.h | 3 ++- + plugins/clang/duchain/builder.cpp | 2 +- + plugins/clang/duchain/cursorkindtraits.h | 2 +- + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/kdevplatform/language/duchain/types/integraltype.h b/kdevplatform/language/duchain/types/integraltype.h +index 32b9b0084c..75516111c7 100644 +--- kdevplatform/language/duchain/types/integraltype.h ++++ kdevplatform/language/duchain/types/integraltype.h +@@ -50,7 +50,8 @@ public: + TypeChar16_t, + TypeChar32_t, + TypeHalf, +- TypeLanguageSpecific = 200 ++ TypeLanguageSpecific = 200, ++ TypeNotIntegralType = 255 + }; + + /// Default constructor +diff --git a/plugins/clang/duchain/builder.cpp b/plugins/clang/duchain/builder.cpp +index a75020d02d..76b301468e 100644 +--- plugins/clang/duchain/builder.cpp ++++ plugins/clang/duchain/builder.cpp +@@ -508,7 +508,7 @@ struct Visitor + return context; + } + +- template = dummy> ++ template = dummy> + AbstractType *createType(CXType, CXCursor) + { + // TODO: would be nice to instantiate a ConstantIntegralType here and set a value if possible +diff --git a/plugins/clang/duchain/cursorkindtraits.h b/plugins/clang/duchain/cursorkindtraits.h +index 2bd4c83c4f..0e0c6bcdc0 100644 +--- plugins/clang/duchain/cursorkindtraits.h ++++ plugins/clang/duchain/cursorkindtraits.h +@@ -214,7 +214,7 @@ constexpr IntegralType::CommonIntegralTypes integralType(CXTypeKind TK) + ||TK == CXType_Char_S + ||TK == CXType_UChar + ||TK == CXType_SChar) ? IntegralType::TypeChar +- : static_cast(-1); ++ : IntegralType::TypeNotIntegralType; + } + + constexpr bool isArrayType(CXTypeKind TK) +-- +GitLab +