diff options
author | Marco Bubke <marco.bubke@qt.io> | 2023-05-10 11:03:35 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2023-05-10 09:22:42 +0000 |
commit | bd9f49f026b489e90d5dfe445b717db85025b8e8 (patch) | |
tree | 2dd7a755a62134030e4e6f8e75dc03e6840a0e36 | |
parent | a881be85f8f85fe7ded066ed17f29f80dbf9bbf7 (diff) | |
download | qt-creator-bd9f49f026b489e90d5dfe445b717db85025b8e8.tar.gz |
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>
-rw-r--r-- | src/plugins/qmldesigner/designercore/model/model.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/designercore/model/model.cpp b/src/plugins/qmldesigner/designercore/model/model.cpp index f9d23ba4aa..e630cc96d8 100644 --- a/src/plugins/qmldesigner/designercore/model/model.cpp +++ b/src/plugins/qmldesigner/designercore/model/model.cpp @@ -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, |