From 7f51ae710576b5f352c891f64a3d32826d0583ca Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 22 Aug 2022 14:21:36 +0200 Subject: [PATCH] QDS: Fix warnings for GCC 11.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [[maybe_unused]] leads to warning: ‘maybe_unused’ attribute ignored [-Wattributes] when compiling with g++, so we instead completely remove the declaration instead. Change-Id: I00650f78d61a0da18e76cd65908fc4a2abda174a Reviewed-by: Reviewed-by: Thomas Hartmann --- .../designercore/projectstorage/qmldocumentparser.h | 11 +++++++++-- .../designercore/projectstorage/qmltypesparser.h | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.h b/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.h index 7a768d990bd..7c29fa2df65 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmldocumentparser.h @@ -19,10 +19,15 @@ public: using ProjectStorage = QmlDesigner::ProjectStorage; using PathCache = QmlDesigner::SourcePathCache; +#ifdef QDS_HAS_QMLDOM QmlDocumentParser(ProjectStorage &storage, PathCache &pathCache) : m_storage{storage} , m_pathCache{pathCache} {} +#else + QmlDocumentParser(ProjectStorage &, PathCache &) + {} +#endif Storage::Synchronization::Type parse(const QString &sourceContent, Storage::Synchronization::Imports &imports, @@ -31,7 +36,9 @@ public: private: // m_pathCache and m_storage are only used when compiled for QDS - [[maybe_unused]] ProjectStorage &m_storage; - [[maybe_unused]] PathCache &m_pathCache; +#ifdef QDS_HAS_QMLDOM + ProjectStorage &m_storage; + PathCache &m_pathCache; +#endif }; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h index f9d28772908..a0575580668 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/qmltypesparser.h @@ -24,10 +24,15 @@ public: using ProjectStorage = QmlDesigner::ProjectStorage; using PathCache = QmlDesigner::SourcePathCache; +#ifdef QDS_HAS_QMLDOM QmlTypesParser(PathCache &pathCache, ProjectStorage &storage) : m_pathCache{pathCache} , m_storage{storage} {} +#else + QmlTypesParser(PathCache &, ProjectStorage &) + {} +#endif void parse(const QString &sourceContent, Storage::Synchronization::Imports &imports, @@ -36,7 +41,10 @@ public: private: // m_pathCache and m_storage are only used when compiled for QDS - [[maybe_unused]] PathCache &m_pathCache; - [[maybe_unused]] ProjectStorage &m_storage; +#ifdef QDS_HAS_QMLDOM + PathCache &m_pathCache; + ProjectStorage &m_storage; +#endif }; + } // namespace QmlDesigner