From bd9f49f026b489e90d5dfe445b717db85025b8e8 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 10 May 2023 11:03:35 +0200 Subject: [PATCH] QmlDesigner: Workaround wrong Clang warning The function is cleary needed in a constexpr if later. And removing it would not compileeven if the constexpr if is false. Seems Clang is emitting the warning after the constexpr if branch is removed. Change-Id: Ie1988a28cf19d06148f609204c16c3d7753b4c63 Reviewed-by: Burak Hancerli Reviewed-by: Marco Bubke --- src/plugins/qmldesigner/designercore/model/model.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/model/model.cpp b/src/plugins/qmldesigner/designercore/model/model.cpp index f9d23ba4aaf..e630cc96d84 100644 --- a/src/plugins/qmldesigner/designercore/model/model.cpp +++ b/src/plugins/qmldesigner/designercore/model/model.cpp @@ -37,6 +37,7 @@ #include #include #include +#include /*! \defgroup CoreModel @@ -212,6 +213,9 @@ void ModelPrivate::changeNodeType(const InternalNodePointer &node, const TypeNam } namespace { +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wunneeded-internal-declaration") + std::pair decomposeTypePath(Utils::SmallStringView typeName) { auto found = std::find(typeName.rbegin(), typeName.rend(), '.'); @@ -221,6 +225,8 @@ std::pair decomposeTypePath(Util return {{typeName.begin(), std::prev(found.base())}, {found.base(), typeName.end()}}; } + +QT_WARNING_POP } // namespace InternalNodePointer ModelPrivate::createNode(const TypeName &typeName,