forked from qt-creator/qt-creator
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:
@@ -37,6 +37,7 @@
|
|||||||
#include <QHashIterator>
|
#include <QHashIterator>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <qcompilerdetection.h>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\defgroup CoreModel
|
\defgroup CoreModel
|
||||||
@@ -212,6 +213,9 @@ void ModelPrivate::changeNodeType(const InternalNodePointer &node, const TypeNam
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_CLANG("-Wunneeded-internal-declaration")
|
||||||
|
|
||||||
std::pair<Utils::SmallStringView, Utils::SmallStringView> decomposeTypePath(Utils::SmallStringView typeName)
|
std::pair<Utils::SmallStringView, Utils::SmallStringView> decomposeTypePath(Utils::SmallStringView typeName)
|
||||||
{
|
{
|
||||||
auto found = std::find(typeName.rbegin(), typeName.rend(), '.');
|
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()}};
|
return {{typeName.begin(), std::prev(found.base())}, {found.base(), typeName.end()}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QT_WARNING_POP
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
InternalNodePointer ModelPrivate::createNode(const TypeName &typeName,
|
InternalNodePointer ModelPrivate::createNode(const TypeName &typeName,
|
||||||
|
Reference in New Issue
Block a user