Remove handling of missing =delete and =default support

Change-Id: I006dfd0b7cfa3bda5e5ab01bcefa851f031dfe0e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Allan Sandfeld Jensen 2019-04-30 17:53:53 +02:00
parent 7a0d4b39da
commit a2b38f64e6
14 changed files with 24 additions and 32 deletions

View File

@ -422,8 +422,8 @@ typedef double qreal;
operator to disable copying (the compiler gives an error message).
*/
#define Q_DISABLE_COPY(Class) \
Class(const Class &) Q_DECL_EQ_DELETE;\
Class &operator=(const Class &) Q_DECL_EQ_DELETE;
Class(const Class &) = delete;\
Class &operator=(const Class &) = delete;
#define Q_DISABLE_MOVE(Class) \
Class(Class &&) = delete; \
@ -1021,7 +1021,7 @@ template <typename T>
Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
// prevent rvalue arguments:
template <typename T>
void qAsConst(const T &&) Q_DECL_EQ_DELETE;
void qAsConst(const T &&) = delete;
#ifndef QT_NO_FOREACH

View File

@ -183,7 +183,7 @@ private:
// signature() has been renamed to methodSignature() in Qt 5.
// Warning, that function returns a QByteArray; check the life time if
// you convert to char*.
char *signature(struct renamedInQt5_warning_checkTheLifeTime * = nullptr) Q_DECL_EQ_DELETE;
char *signature(struct renamedInQt5_warning_checkTheLifeTime * = nullptr) = delete;
#endif
static QMetaMethod fromSignalImpl(const QMetaObject *, void **);

View File

@ -849,7 +849,7 @@ struct VariantData
const uint flags;
private:
// copy constructor allowed to be implicit to silence level 4 warning from MSVC
VariantData &operator=(const VariantData &) Q_DECL_EQ_DELETE;
VariantData &operator=(const VariantData &) = delete;
};
template<typename const_iterator>

View File

@ -483,27 +483,27 @@ public:
private:
// force compile error, prevent QVariant(bool) to be called
inline QVariant(void *) Q_DECL_EQ_DELETE;
inline QVariant(void *) = delete;
// QVariant::Type is marked as \obsolete, but we don't want to
// provide a constructor from its intended replacement,
// QMetaType::Type, instead, because the idea behind these
// constructors is flawed in the first place. But we also don't
// want QVariant(QMetaType::String) to compile and falsely be an
// int variant, so delete this constructor:
QVariant(QMetaType::Type) Q_DECL_EQ_DELETE;
QVariant(QMetaType::Type) = delete;
// These constructors don't create QVariants of the type associcated
// with the enum, as expected, but they would create a QVariant of
// type int with the value of the enum value.
// Use QVariant v = QColor(Qt::red) instead of QVariant v = Qt::red for
// example.
QVariant(Qt::GlobalColor) Q_DECL_EQ_DELETE;
QVariant(Qt::BrushStyle) Q_DECL_EQ_DELETE;
QVariant(Qt::PenStyle) Q_DECL_EQ_DELETE;
QVariant(Qt::CursorShape) Q_DECL_EQ_DELETE;
QVariant(Qt::GlobalColor) = delete;
QVariant(Qt::BrushStyle) = delete;
QVariant(Qt::PenStyle) = delete;
QVariant(Qt::CursorShape) = delete;
#ifdef QT_NO_CAST_FROM_ASCII
// force compile error when implicit conversion is not wanted
inline QVariant(const char *) Q_DECL_EQ_DELETE;
inline QVariant(const char *) = delete;
#endif
public:
typedef Private DataPtr;

View File

@ -462,7 +462,7 @@ template <typename X> struct QAtomicOps
}
};
#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
#if defined(Q_COMPILER_CONSTEXPR)
# define Q_BASIC_ATOMIC_INITIALIZER(a) { a }
#else
# define Q_BASIC_ATOMIC_INITIALIZER(a) { ATOMIC_VAR_INIT(a) }

View File

@ -75,7 +75,7 @@ QT_END_NAMESPACE
// New atomics
#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
#if defined(Q_COMPILER_CONSTEXPR)
# if defined(Q_CC_CLANG) && Q_CC_CLANG < 303
/*
Do not define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS for Clang before version 3.3.

View File

@ -209,7 +209,6 @@ struct Callable
{
}
#if defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
// Apply the same semantics of a lambda closure type w.r.t. the special
// member functions, if possible: delete the copy assignment operator,
// bring back all the others as per the RO5 (cf. §8.1.5.1/11 [expr.prim.lambda.closure])
@ -218,7 +217,6 @@ struct Callable
Callable(Callable &&) = default;
Callable &operator=(const Callable &) = delete;
Callable &operator=(Callable &&) = default;
#endif
void operator()()
{

View File

@ -142,7 +142,7 @@ private:
rightNode()->destroySubTree();
}
QMapNode() Q_DECL_EQ_DELETE;
QMapNode() = delete;
Q_DISABLE_COPY(QMapNode)
};

View File

@ -235,8 +235,8 @@ namespace QtSharedPointer {
}
private:
// prevent construction
ExternalRefCountWithCustomDeleter() Q_DECL_EQ_DELETE;
~ExternalRefCountWithCustomDeleter() Q_DECL_EQ_DELETE;
ExternalRefCountWithCustomDeleter() = delete;
~ExternalRefCountWithCustomDeleter() = delete;
Q_DISABLE_COPY(ExternalRefCountWithCustomDeleter)
};
@ -280,8 +280,8 @@ namespace QtSharedPointer {
private:
// prevent construction
ExternalRefCountWithContiguousData() Q_DECL_EQ_DELETE;
~ExternalRefCountWithContiguousData() Q_DECL_EQ_DELETE;
ExternalRefCountWithContiguousData() = delete;
~ExternalRefCountWithContiguousData() = delete;
Q_DISABLE_COPY(ExternalRefCountWithContiguousData)
};
@ -705,11 +705,7 @@ template <class T>
class QEnableSharedFromThis
{
protected:
#ifdef Q_COMPILER_DEFAULT_MEMBERS
QEnableSharedFromThis() = default;
#else
Q_DECL_CONSTEXPR QEnableSharedFromThis() {}
#endif
QEnableSharedFromThis(const QEnableSharedFromThis &) {}
QEnableSharedFromThis &operator=(const QEnableSharedFromThis &) { return *this; }

View File

@ -150,7 +150,7 @@ class QStringBuilder <QString, QString> : public QStringBuilderBase<QStringBuild
const QString &b;
private:
QStringBuilder &operator=(const QStringBuilder &) Q_DECL_EQ_DELETE;
QStringBuilder &operator=(const QStringBuilder &) = delete;
};
template <>
@ -167,7 +167,7 @@ class QStringBuilder <QByteArray, QByteArray> : public QStringBuilderBase<QStrin
const QByteArray &b;
private:
QStringBuilder &operator=(const QStringBuilder &) Q_DECL_EQ_DELETE;
QStringBuilder &operator=(const QStringBuilder &) = delete;
};

View File

@ -94,7 +94,7 @@ public:
virtual void virtual_hook(int id, void *data);
private:
QIconEngine &operator=(const QIconEngine &other) Q_DECL_EQ_DELETE;
QIconEngine &operator=(const QIconEngine &other) = delete;
};
#if QT_DEPRECATED_SINCE(5, 0)

View File

@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
class Q_WIDGETS_EXPORT QToolTip
{
QToolTip() Q_DECL_EQ_DELETE;
QToolTip() = delete;
public:
// ### Qt 6 - merge the three showText functions below
static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr);

View File

@ -54,7 +54,7 @@ class QAction;
class Q_WIDGETS_EXPORT QWhatsThis
{
QWhatsThis() Q_DECL_EQ_DELETE;
QWhatsThis() = delete;
public:
static void enterWhatsThisMode();

View File

@ -116,12 +116,10 @@ class Q_XML_EXPORT QXmlAttributes
{
public:
QXmlAttributes();
#ifdef Q_COMPILER_DEFAULT_MEMBERS
QXmlAttributes(const QXmlAttributes &) = default;
QXmlAttributes(QXmlAttributes &&) noexcept = default;
QXmlAttributes &operator=(const QXmlAttributes &) = default;
QXmlAttributes &operator=(QXmlAttributes &&) noexcept = default;
#endif // default members
QT6_NOT_VIRTUAL ~QXmlAttributes();