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 <burak.hancerli@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Marco Bubke
2023-05-10 11:03:35 +02:00
parent a881be85f8
commit bd9f49f026

View File

@@ -37,6 +37,7 @@
#include <QHashIterator>
#include <QPointer>
#include <QRegularExpression>
#include <qcompilerdetection.h>
/*!
\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<Utils::SmallStringView, Utils::SmallStringView> decomposeTypePath(Utils::SmallStringView typeName)
{
auto found = std::find(typeName.rbegin(), typeName.rend(), '.');
@@ -221,6 +225,8 @@ std::pair<Utils::SmallStringView, Utils::SmallStringView> decomposeTypePath(Util
return {{typeName.begin(), std::prev(found.base())}, {found.base(), typeName.end()}};
}
QT_WARNING_POP
} // namespace
InternalNodePointer ModelPrivate::createNode(const TypeName &typeName,