From 97994d7ce9cf3779e7b1c64a52bbc1436a441f43 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 18 Dec 2023 13:38:00 +0100 Subject: [PATCH] Tracing: Fix compile error ff7d69daf in Qt base added a static assert. In file included from /data/dev/creator/src/libs/tracing/timelinetracemanager.cpp:6: In file included from /data/dev/creator/src/libs/tracing/timelinetracemanager.h:8: /data/dev/creator/src/libs/tracing/traceeventtype.h:45:1: error: static assertion failed due to requirement '!isRelocatable || std::is_copy_constructible_v || std::is_move_constructible_v': Timeline::TraceEventType is neither copy- nor move-constructible, so cannot be Q_RELOCATABLE_TYPE Q_DECLARE_TYPEINFO(Timeline::TraceEventType, Q_MOVABLE_TYPE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /data/dev/qt-6/qtbase/include/QtCore/../../src/corelib/global/qtypeinfo.h:173:12: note: expanded from macro 'Q_DECLARE_TYPEINFO' template<> \ ^ /data/dev/qt-6/qtbase/include/QtCore/../../src/corelib/global/qtypeinfo.h:166:5: note: expanded from macro '\ Q_DECLARE_TYPEINFO_BODY' static_assert(!isRelocatable || \ ^ ~~~~~~~~~~~~~~~~~~~ /data/dev/creator/src/libs/tracing/traceeventtype.h:45:1: note: expression evaluates to 'false || false' Q_DECLARE_TYPEINFO(Timeline::TraceEventType, Q_MOVABLE_TYPE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /data/dev/qt-6/qtbase/include/QtCore/../../src/corelib/global/qtypeinfo.h:173:12: note: expanded from macro 'Q_DECLARE_TYPEINFO' template<> \ ^ /data/dev/qt-6/qtbase/include/QtCore/../../src/corelib/global/qtypeinfo.h:167:55: note: expanded from macro '\ Q_DECLARE_TYPEINFO_BODY' std::is_copy_constructible_v || \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ 1 error generated. Change-Id: I68c963f6b2856e9aca3e8be65ac177456a02a875 (cherry picked from commit 2632f991236663b281dccd43a2ccc47436677198) Reviewed-by: Ulf Hermann --- src/libs/tracing/traceevent.h | 10 +++++----- src/libs/tracing/traceeventtype.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libs/tracing/traceevent.h b/src/libs/tracing/traceevent.h index d9de9641797..99a17814a85 100644 --- a/src/libs/tracing/traceevent.h +++ b/src/libs/tracing/traceevent.h @@ -14,6 +14,11 @@ namespace Timeline { class TraceEvent : public SafeCastable { public: + TraceEvent(const TraceEvent &) = default; + TraceEvent(TraceEvent &&) = default; + TraceEvent &operator=(const TraceEvent &) = default; + TraceEvent &operator=(TraceEvent &&) = default; + qint64 timestamp() const { return m_timestamp; } void setTimestamp(qint64 timestamp) { m_timestamp = timestamp; } @@ -29,11 +34,6 @@ protected: : m_timestamp(timestamp), m_typeIndex(typeIndex), m_classId(classId) {} - TraceEvent(const TraceEvent &) = default; - TraceEvent(TraceEvent &&) = default; - TraceEvent &operator=(const TraceEvent &) = default; - TraceEvent &operator=(TraceEvent &&) = default; - private: qint64 m_timestamp; qint32 m_typeIndex; diff --git a/src/libs/tracing/traceeventtype.h b/src/libs/tracing/traceeventtype.h index 1a2be2694b8..fd87ba141a4 100644 --- a/src/libs/tracing/traceeventtype.h +++ b/src/libs/tracing/traceeventtype.h @@ -15,6 +15,11 @@ namespace Timeline { class TraceEventType : public SafeCastable { public: + TraceEventType(const TraceEventType &) = default; + TraceEventType(TraceEventType &&) = default; + TraceEventType &operator=(const TraceEventType &) = default; + TraceEventType &operator=(TraceEventType &&) = default; + const QString &displayName() const { return m_displayName; } void setDisplayName(const QString &displayName) { m_displayName = displayName; } @@ -28,11 +33,6 @@ protected: : m_displayName(displayName), m_classId(classId), m_feature(feature) {} - TraceEventType(const TraceEventType &) = default; - TraceEventType(TraceEventType &&) = default; - TraceEventType &operator=(const TraceEventType &) = default; - TraceEventType &operator=(TraceEventType &&) = default; - private: QString m_displayName; qint32 m_classId;