summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-01-18 09:06:59 +0100
committerMarc Mutz <marc.mutz@qt.io>2024-01-18 12:48:03 +0100
commit11d153ae1ce3ce75e76a1fcac7bf99e4cff05716 (patch)
tree0793dc52f12cc040c8005699a87188bd4ab29c28
parent54824e7d2bf1066014f4e6f3bb3c2a9535435779 (diff)
QMetaTypeModuleHelper: suppress cppcoreguidelines-virtual-class-destructor
Says clang-tidy: destructor of '(unnamed struct at qmetatype.cpp:966:14)' is public and non-virtual in file:src/corelib/kernel/qmetatype.cpp line:966 col:14 static const struct : QMetaTypeModuleHelper Yes, these classes are polymorphic (because the base class is). Yes, the destructor is non-virtual (because the base class' one isn't, but it's also protected, so fine). But these classes are not used as base classes, so suppress the warning. Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I75be86bca36a4a0e93d72acb1a0d2fe0dca1c505 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--src/corelib/kernel/qmetatype.cpp1
-rw-r--r--src/gui/kernel/qguivariant.cpp1
-rw-r--r--src/widgets/kernel/qwidgetsvariant.cpp1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index a008485d8a..3f22a05b07 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -963,6 +963,7 @@ static const struct { const char * typeName; int typeNameLength; int type; } typ
{nullptr, 0, QMetaType::UnknownType}
};
+// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
static const struct : QMetaTypeModuleHelper
{
template<typename T, typename LiteralWrapper =
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 4fdc744029..1b60c7c9d6 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -56,6 +56,7 @@ QT_BEGIN_NAMESPACE
namespace {
+// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
static const struct : QMetaTypeModuleHelper
{
#define QT_IMPL_METATYPEINTERFACE_GUI_TYPES(MetaTypeName, MetaTypeId, RealName) \
diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp
index f5d511abd2..459f95c0fb 100644
--- a/src/widgets/kernel/qwidgetsvariant.cpp
+++ b/src/widgets/kernel/qwidgetsvariant.cpp
@@ -12,6 +12,7 @@ QT_BEGIN_NAMESPACE
namespace {
+// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
static const struct : QMetaTypeModuleHelper
{
const QtPrivate::QMetaTypeInterface *interfaceForType(int type) const override {