Fix incompatibility with GCC < 10.1.

This commit is contained in:
Roman Telezhynskyi 2023-07-15 17:35:16 +03:00
parent b44919c53e
commit 30aa5e7c22
2 changed files with 15 additions and 2 deletions

View file

@ -39,6 +39,7 @@
#include <Qt>
#include <QtGlobal>
#include "../vmisc/def.h"
#include "../vmisc/defglobal.h"
class VPieceLabelData;
@ -74,7 +75,7 @@ class VTextManager
Q_DECLARE_TR_FUNCTIONS(VTextManager) // NOLINT
public:
VTextManager() noexcept = default;
DEF_CONSTRUCTOR(VTextManager)
virtual ~VTextManager() = default;
VTextManager(const VTextManager &text) = default;

View file

@ -68,7 +68,7 @@ template <class T> class QSharedPointer;
#endif
#endif
#if defined(Q_COMPILER_GCC) && defined(Q_CC_GNU) && defined(Q_CC_GNU_VERSION) && (Q_CC_GNU_VERSION <= 40900)
#if (defined(Q_CC_GNU) && Q_CC_GNU <= 409) && !defined(Q_CC_CLANG)
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define COPY_CONSTRUCTOR_IMPL(className) \
className::className(const className &item) \
@ -90,6 +90,18 @@ template <class T> class QSharedPointer;
#define COPY_CONSTRUCTOR_IMPL_2(className, baseClassName) className::className(const className &) = default;
#endif
// https://stackoverflow.com/questions/75008386/constructor-is-implicitly-deleted-because-its-exception-specification-does-not-m
#if (defined(Q_CC_GNU) && Q_CC_GNU < 1001) && !defined(Q_CC_CLANG)
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define DEF_CONSTRUCTOR(className) \
className() noexcept \
{ \
}
#else
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define DEF_CONSTRUCTOR(className) className() noexcept = default;
#endif
class QComboBox;
class QMarginsF;
class VTranslateMeasurements;