From 8d7c97d428cdf89c3419a4e13b62a9849feefce9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 4 Apr 2019 16:46:41 +0200 Subject: Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usage Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 4 +- src/corelib/global/qglobalstatic.h | 2 +- src/corelib/global/qrandom.cpp | 4 +- src/corelib/global/qtypeinfo.h | 2 +- src/corelib/itemmodels/qitemselectionmodel.cpp | 4 +- src/corelib/kernel/qcore_mac_p.h | 2 +- src/corelib/statemachine/qstatemachine_p.h | 4 +- src/corelib/tools/qdatetime.cpp | 2 +- src/corelib/tools/qdatetime.h | 2 +- src/corelib/tools/qhash.h | 4 +- src/corelib/tools/qhashfunctions.h | 14 +++--- src/corelib/tools/qiterator.h | 2 +- src/corelib/tools/qlist.h | 10 ++-- src/corelib/tools/qpair.h | 30 ++++++------ src/corelib/tools/qscopedpointer.h | 2 +- src/corelib/tools/qset.h | 2 +- src/corelib/tools/qvarlengtharray.h | 8 ++-- src/corelib/tools/qvector.h | 10 ++-- src/dbus/qdbusargument.h | 6 +-- src/dbus/qdbusconnection.h | 6 +-- src/dbus/qdbuserror.h | 6 +-- src/dbus/qdbusextratypes.h | 14 +++--- src/dbus/qdbusintegrator_p.h | 4 +- src/dbus/qdbusmessage.h | 4 +- src/dbus/qdbuspendingcall.h | 4 +- src/dbus/qdbusunixfiledescriptor.h | 4 +- src/network/access/qabstractnetworkcache.h | 4 +- src/network/access/qhstspolicy.h | 4 +- src/network/access/qhttpmultipart.h | 4 +- src/network/access/qnetworkcookie.h | 4 +- src/network/access/qnetworkrequest.h | 4 +- src/network/bearer/qnetworkconfiguration.h | 4 +- src/network/kernel/qdnslookup.h | 20 ++++---- src/network/kernel/qhostaddress.cpp | 2 +- src/network/kernel/qhostaddress.h | 8 ++-- src/network/kernel/qhostinfo.cpp | 4 +- src/network/kernel/qhostinfo.h | 4 +- src/network/kernel/qnetworkdatagram.h | 6 +-- src/network/kernel/qnetworkinterface.h | 8 ++-- src/network/kernel/qnetworkproxy.h | 8 ++-- src/network/ssl/qocspresponse.cpp | 4 +- src/network/ssl/qocspresponse.h | 6 +-- src/network/ssl/qsslcertificate.h | 8 ++-- src/network/ssl/qsslcertificate_openssl.cpp | 2 +- src/network/ssl/qsslcertificate_qt.cpp | 2 +- src/network/ssl/qsslcertificateextension.h | 4 +- src/network/ssl/qsslcipher.h | 4 +- src/network/ssl/qsslconfiguration.h | 4 +- src/network/ssl/qssldiffiehellmanparameters.cpp | 12 ++--- src/network/ssl/qssldiffiehellmanparameters.h | 24 +++++----- src/network/ssl/qsslellipticcurve.h | 18 +++---- src/network/ssl/qsslellipticcurve_dummy.cpp | 2 +- src/network/ssl/qsslellipticcurve_openssl.cpp | 2 +- src/network/ssl/qsslerror.cpp | 2 +- src/network/ssl/qsslerror.h | 6 +-- src/network/ssl/qsslkey.h | 4 +- src/network/ssl/qsslpresharedkeyauthenticator.h | 4 +- .../input/evdevkeyboard/qevdevkeyboardhandler.cpp | 2 +- .../input/evdevkeyboard/qevdevkeyboardhandler_p.h | 8 ++-- src/plugins/platforms/windows/qwindowscursor.h | 2 +- .../platforms/xcb/nativepainting/qt_x11_p.h | 2 +- src/plugins/platforms/xcb/qxcbconnection_basic.h | 2 +- src/plugins/platforms/xcb/qxcbcursor.h | 2 +- src/printsupport/dialogs/qprintdialog_unix.cpp | 10 ++-- src/printsupport/kernel/qcups.cpp | 4 +- src/sql/kernel/qsqlerror.h | 6 +-- src/sql/models/qsqlrelationaltablemodel.h | 4 +- src/widgets/dialogs/qdialog_p.h | 10 ++-- src/widgets/kernel/qsizepolicy.cpp | 4 +- src/widgets/kernel/qsizepolicy.h | 56 +++++++++++----------- src/widgets/widgets/qcalendarwidget.cpp | 12 ++--- src/xml/sax/qxml.h | 6 +-- 72 files changed, 239 insertions(+), 239 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 223ebbcabe..6f51c25747 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -910,14 +910,14 @@ namespace SwapExceptionTester { // insulate users from the "using std::swap" bel using std::swap; // import std::swap template void checkSwap(T &t) - Q_DECL_NOEXCEPT_EXPR(noexcept(swap(t, t))); + noexcept(noexcept(swap(t, t))); // declared, but not implemented (only to be used in unevaluated contexts (noexcept operator)) } } // namespace QtPrivate template inline void qSwap(T &value1, T &value2) - Q_DECL_NOEXCEPT_EXPR(noexcept(QtPrivate::SwapExceptionTester::checkSwap(value1))) + noexcept(noexcept(QtPrivate::SwapExceptionTester::checkSwap(value1))) { using std::swap; swap(value1, value2); diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h index 93d71cee57..f5c46e9392 100644 --- a/src/corelib/global/qglobalstatic.h +++ b/src/corelib/global/qglobalstatic.h @@ -86,7 +86,7 @@ enum GuardValues { static struct Holder : public HolderBase { \ Type value; \ Holder() \ - Q_DECL_NOEXCEPT_EXPR(noexcept(Type ARGS)) \ + noexcept(noexcept(Type ARGS)) \ : value ARGS \ { guard.store(QtGlobalStatic::Initialized); } \ } holder; \ diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 6195c324e7..6cc46bcf39 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -219,7 +219,7 @@ struct QRandomGenerator::SystemGenerator static SystemGenerator &self(); typedef quint32 result_type; - void generate(quint32 *begin, quint32 *end) Q_DECL_NOEXCEPT_EXPR(FillBufferNoexcept); + void generate(quint32 *begin, quint32 *end) noexcept(FillBufferNoexcept); // For std::mersenne_twister_engine implementations that use something // other than quint32 (unsigned int) to fill their buffers. @@ -354,7 +354,7 @@ static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW #endif Q_NEVER_INLINE void QRandomGenerator::SystemGenerator::generate(quint32 *begin, quint32 *end) - Q_DECL_NOEXCEPT_EXPR(FillBufferNoexcept) + noexcept(FillBufferNoexcept) { quint32 *buffer = begin; qsizetype count = end - begin; diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 567ff5c08e..636dc24c07 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -308,7 +308,7 @@ Q_DECLARE_TYPEINFO_BODY(QFlags, Q_PRIMITIVE_TYPE); #define Q_DECLARE_SHARED_IMPL(TYPE, FLAGS) \ Q_DECLARE_TYPEINFO(TYPE, FLAGS); \ inline void swap(TYPE &value1, TYPE &value2) \ - Q_DECL_NOEXCEPT_EXPR(noexcept(value1.swap(value2))) \ + noexcept(noexcept(value1.swap(value2))) \ { value1.swap(value2); } #define Q_DECLARE_SHARED(TYPE) Q_DECLARE_SHARED_IMPL(TYPE, Q_MOVABLE_TYPE) #define Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(TYPE) \ diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index 1bacb63b17..c93a4d15b9 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -1273,10 +1273,10 @@ struct IsNotValid { typedef bool result_type; struct is_transparent : std::true_type {}; template - Q_DECL_CONSTEXPR bool operator()(T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(t.isValid())) + Q_DECL_CONSTEXPR bool operator()(T &t) const noexcept(noexcept(t.isValid())) { return !t.isValid(); } template - Q_DECL_CONSTEXPR bool operator()(T *t) const Q_DECL_NOEXCEPT_EXPR(noexcept(t->isValid())) + Q_DECL_CONSTEXPR bool operator()(T *t) const noexcept(noexcept(t->isValid())) { return !t->isValid(); } }; } diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h index f96e7358a2..920105ee9e 100644 --- a/src/corelib/kernel/qcore_mac_p.h +++ b/src/corelib/kernel/qcore_mac_p.h @@ -90,7 +90,7 @@ public: QAppleRefCounted(const QAppleRefCounted &other) : value(other.value) { if (value) RetainFunction(value); } ~QAppleRefCounted() { if (value) ReleaseFunction(value); } operator T() const { return value; } - void swap(QAppleRefCounted &other) Q_DECL_NOEXCEPT_EXPR(noexcept(qSwap(value, other.value))) + void swap(QAppleRefCounted &other) noexcept(noexcept(qSwap(value, other.value))) { qSwap(value, other.value); } QAppleRefCounted &operator=(const QAppleRefCounted &other) { QAppleRefCounted copy(other); swap(copy); return *this; } diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h index c66130b8ce..93756f0e66 100644 --- a/src/corelib/statemachine/qstatemachine_p.h +++ b/src/corelib/statemachine/qstatemachine_p.h @@ -218,9 +218,9 @@ public: QByteArray prop; // two overloads because friends can't have default arguments friend uint qHash(const RestorableId &key, uint seed) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(std::declval()))) + noexcept(noexcept(qHash(std::declval()))) { return qHash(qMakePair(key.obj, key.prop), seed); } - friend uint qHash(const RestorableId &key) Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key, 0U))) + friend uint qHash(const RestorableId &key) noexcept(noexcept(qHash(key, 0U))) { return qHash(key, 0U); } friend bool operator==(const RestorableId &lhs, const RestorableId &rhs) Q_DECL_NOTHROW { return lhs.obj == rhs.obj && lhs.prop == rhs.prop; } diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 80d6dada60..fafe7731ce 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -3132,7 +3132,7 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT \sa isValid() */ -QDateTime::QDateTime() Q_DECL_NOEXCEPT_EXPR(Data::CanBeSmall) +QDateTime::QDateTime() noexcept(Data::CanBeSmall) { } diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index 43271b34ed..66947881c8 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -258,7 +258,7 @@ class Q_CORE_EXPORT QDateTime }; public: - QDateTime() Q_DECL_NOEXCEPT_EXPR(Data::CanBeSmall); + QDateTime() noexcept(Data::CanBeSmall); explicit QDateTime(const QDate &); QDateTime(const QDate &, const QTime &, Qt::TimeSpec spec = Qt::LocalTime); // ### Qt 6: Merge with above with default offsetSeconds = 0 diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index a586ca5671..7e6506f796 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -1130,7 +1130,7 @@ Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR(Hash) template uint qHash(const QHash &key, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(std::declval())) && noexcept(qHash(std::declval()))) + noexcept(noexcept(qHash(std::declval())) && noexcept(qHash(std::declval()))) { QtPrivate::QHashCombineCommutative hash; for (auto it = key.begin(), end = key.end(); it != end; ++it) { @@ -1143,7 +1143,7 @@ uint qHash(const QHash &key, uint seed = 0) template inline uint qHash(const QMultiHash &key, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(std::declval())) && noexcept(qHash(std::declval()))) + noexcept(noexcept(qHash(std::declval())) && noexcept(qHash(std::declval()))) { const QHash &key2 = key; return qHash(key2, seed); diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h index d013c26d66..1d30e71053 100644 --- a/src/corelib/tools/qhashfunctions.h +++ b/src/corelib/tools/qhashfunctions.h @@ -114,7 +114,7 @@ template inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW return qHash(reinterpret_cast(key), seed); } template inline uint qHash(const T &t, uint seed) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t))) + noexcept(noexcept(qHash(t))) { return qHash(t) ^ seed; } namespace QtPrivate { @@ -122,7 +122,7 @@ namespace QtPrivate { struct QHashCombine { typedef uint result_type; template - Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t))) + Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const noexcept(noexcept(qHash(t))) // combiner taken from N3876 / boost::hash_combine { return seed ^ (qHash(t) + 0x9e3779b9 + (seed << 6) + (seed >> 2)) ; } }; @@ -135,7 +135,7 @@ struct QHashCombineCommutative { // QHash). Therefore, provide a commutative combiner, too. typedef uint result_type; template - Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t))) + Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const noexcept(noexcept(qHash(t))) { return seed + qHash(t); } // don't use xor! }; @@ -143,20 +143,20 @@ struct QHashCombineCommutative { template inline uint qHashRange(InputIterator first, InputIterator last, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(*first))) // assume iterator operations don't throw + noexcept(noexcept(qHash(*first))) // assume iterator operations don't throw { return std::accumulate(first, last, seed, QtPrivate::QHashCombine()); } template inline uint qHashRangeCommutative(InputIterator first, InputIterator last, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(*first))) // assume iterator operations don't throw + noexcept(noexcept(qHash(*first))) // assume iterator operations don't throw { return std::accumulate(first, last, seed, QtPrivate::QHashCombineCommutative()); } template inline uint qHash(const QPair &key, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed))) + noexcept(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed))) { uint h1 = qHash(key.first, seed); uint h2 = qHash(key.second, seed); @@ -164,7 +164,7 @@ template inline uint qHash(const QPair &key, } template inline uint qHash(const std::pair &key, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed))) + noexcept(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed))) { QtPrivate::QHashCombine hash; seed = hash(seed, key.first); diff --git a/src/corelib/tools/qiterator.h b/src/corelib/tools/qiterator.h index 586d26cbad..f659e88b5e 100644 --- a/src/corelib/tools/qiterator.h +++ b/src/corelib/tools/qiterator.h @@ -190,7 +190,7 @@ public: typedef const value_type &reference; QKeyValueIterator() = default; - Q_DECL_CONSTEXPR explicit QKeyValueIterator(Iterator o) Q_DECL_NOEXCEPT_EXPR(std::is_nothrow_move_constructible::value) + Q_DECL_CONSTEXPR explicit QKeyValueIterator(Iterator o) noexcept(std::is_nothrow_move_constructible::value) : i(std::move(o)) {} std::pair operator*() const { diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 34577acaa5..7532997c93 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -1121,14 +1121,14 @@ Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(List) template uint qHash(const QList &key, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHashRange(key.cbegin(), key.cend(), seed))) + noexcept(noexcept(qHashRange(key.cbegin(), key.cend(), seed))) { return qHashRange(key.cbegin(), key.cend(), seed); } template bool operator<(const QList &lhs, const QList &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(), + noexcept(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()))) { return std::lexicographical_compare(lhs.begin(), lhs.end(), @@ -1137,21 +1137,21 @@ bool operator<(const QList &lhs, const QList &rhs) template inline bool operator>(const QList &lhs, const QList &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return rhs < lhs; } template inline bool operator<=(const QList &lhs, const QList &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return !(lhs > rhs); } template inline bool operator>=(const QList &lhs, const QList &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return !(lhs < rhs); } diff --git a/src/corelib/tools/qpair.h b/src/corelib/tools/qpair.h index 1af43d0a68..6d1e67efb7 100644 --- a/src/corelib/tools/qpair.h +++ b/src/corelib/tools/qpair.h @@ -52,41 +52,41 @@ struct QPair typedef T2 second_type; Q_DECL_CONSTEXPR QPair() - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_default_constructible::value && + noexcept((std::is_nothrow_default_constructible::value && std::is_nothrow_default_constructible::value)) : first(), second() {} Q_DECL_CONSTEXPR QPair(const T1 &t1, const T2 &t2) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_copy_constructible::value && + noexcept((std::is_nothrow_copy_constructible::value && std::is_nothrow_copy_constructible::value)) : first(t1), second(t2) {} // compiler-generated copy/move ctor/assignment operators are fine! template Q_DECL_CONSTEXPR QPair(const QPair &p) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_constructible::value && + noexcept((std::is_nothrow_constructible::value && std::is_nothrow_constructible::value)) : first(p.first), second(p.second) {} template Q_DECL_RELAXED_CONSTEXPR QPair &operator=(const QPair &p) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_assignable::value && + noexcept((std::is_nothrow_assignable::value && std::is_nothrow_assignable::value)) { first = p.first; second = p.second; return *this; } #ifdef Q_COMPILER_RVALUE_REFS template Q_DECL_CONSTEXPR QPair(QPair &&p) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_constructible::value && + noexcept((std::is_nothrow_constructible::value && std::is_nothrow_constructible::value)) // can't use std::move here as it's not constexpr in C++11: : first(static_cast(p.first)), second(static_cast(p.second)) {} template Q_DECL_RELAXED_CONSTEXPR QPair &operator=(QPair &&p) - Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_assignable::value && + noexcept((std::is_nothrow_assignable::value && std::is_nothrow_assignable::value)) { first = std::move(p.first); second = std::move(p.second); return *this; } #endif Q_DECL_RELAXED_CONSTEXPR void swap(QPair &other) - Q_DECL_NOEXCEPT_EXPR(noexcept(qSwap(other.first, other.first)) && noexcept(qSwap(other.second, other.second))) + noexcept(noexcept(qSwap(other.first, other.first)) && noexcept(qSwap(other.second, other.second))) { // use qSwap() to pick up ADL swaps automatically: qSwap(first, other.first); @@ -103,7 +103,7 @@ QPair(T1, T2) -> QPair; #endif template -void swap(QPair &lhs, QPair &rhs) Q_DECL_NOEXCEPT_EXPR(noexcept(lhs.swap(rhs))) +void swap(QPair &lhs, QPair &rhs) noexcept(noexcept(lhs.swap(rhs))) { lhs.swap(rhs); } // mark QPair as complex/movable/primitive depending on the @@ -113,45 +113,45 @@ class QTypeInfo > : public QTypeInfoMerger, T1, T2> template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator==(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(p1.first == p2.first && p1.second == p2.second)) + noexcept(noexcept(p1.first == p2.first && p1.second == p2.second)) { return p1.first == p2.first && p1.second == p2.second; } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator!=(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(!(p1 == p2))) + noexcept(noexcept(!(p1 == p2))) { return !(p1 == p2); } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator<(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second))) + noexcept(noexcept(p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second))) { return p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second); } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator>(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(p2 < p1)) + noexcept(noexcept(p2 < p1)) { return p2 < p1; } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator<=(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(!(p2 < p1))) + noexcept(noexcept(!(p2 < p1))) { return !(p2 < p1); } template Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator>=(const QPair &p1, const QPair &p2) - Q_DECL_NOEXCEPT_EXPR(noexcept(!(p1 < p2))) + noexcept(noexcept(!(p1 < p2))) { return !(p1 < p2); } template Q_DECL_CONSTEXPR Q_OUTOFLINE_TEMPLATE QPair qMakePair(const T1 &x, const T2 &y) - Q_DECL_NOEXCEPT_EXPR(noexcept(QPair(x, y))) + noexcept(noexcept(QPair(x, y))) { return QPair(x, y); } diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index 2a4083466b..a91043faba 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -150,7 +150,7 @@ public: return !d; } - void reset(T *other = nullptr) Q_DECL_NOEXCEPT_EXPR(noexcept(Cleanup::cleanup(std::declval()))) + void reset(T *other = nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval()))) { if (d == other) return; diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index 6640c8486d..323942e1bf 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -267,7 +267,7 @@ private: template uint qHash(const QSet &key, uint seed = 0) -Q_DECL_NOEXCEPT_EXPR(noexcept(qHashRangeCommutative(key.begin(), key.end(), seed))) +noexcept(noexcept(qHashRangeCommutative(key.begin(), key.end(), seed))) { return qHashRangeCommutative(key.begin(), key.end(), seed); } diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 597e7464cb..c03fbb2218 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -570,7 +570,7 @@ bool operator!=(const QVarLengthArray &l, const QVarLengthArray bool operator<(const QVarLengthArray &lhs, const QVarLengthArray &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(), + noexcept(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()))) { return std::lexicographical_compare(lhs.begin(), lhs.end(), @@ -579,21 +579,21 @@ bool operator<(const QVarLengthArray &lhs, const QVarLengthArray inline bool operator>(const QVarLengthArray &lhs, const QVarLengthArray &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return rhs < lhs; } template inline bool operator<=(const QVarLengthArray &lhs, const QVarLengthArray &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return !(lhs > rhs); } template inline bool operator>=(const QVarLengthArray &lhs, const QVarLengthArray &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return !(lhs < rhs); } diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 9762ec1b5b..a51b37d02d 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -1062,14 +1062,14 @@ Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(Vector) template uint qHash(const QVector &key, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHashRange(key.cbegin(), key.cend(), seed))) + noexcept(noexcept(qHashRange(key.cbegin(), key.cend(), seed))) { return qHashRange(key.cbegin(), key.cend(), seed); } template bool operator<(const QVector &lhs, const QVector &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(), + noexcept(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()))) { return std::lexicographical_compare(lhs.begin(), lhs.end(), @@ -1078,21 +1078,21 @@ bool operator<(const QVector &lhs, const QVector &rhs) template inline bool operator>(const QVector &lhs, const QVector &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return rhs < lhs; } template inline bool operator<=(const QVector &lhs, const QVector &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return !(lhs > rhs); } template inline bool operator>=(const QVector &lhs, const QVector &rhs) - Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs)) + noexcept(noexcept(lhs < rhs)) { return !(lhs < rhs); } diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index 94a89a4e08..7f4bd269a9 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -77,13 +77,13 @@ public: QDBusArgument(); QDBusArgument(const QDBusArgument &other); #ifdef Q_COMPILER_RVALUE_REFS - QDBusArgument(QDBusArgument &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; } - QDBusArgument &operator=(QDBusArgument &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDBusArgument(QDBusArgument &&other) noexcept : d(other.d) { other.d = nullptr; } + QDBusArgument &operator=(QDBusArgument &&other) noexcept { swap(other); return *this; } #endif QDBusArgument &operator=(const QDBusArgument &other); ~QDBusArgument(); - void swap(QDBusArgument &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QDBusArgument &other) noexcept { qSwap(d, other.d); } // used for marshalling (Qt -> D-BUS) QDBusArgument &operator<<(uchar arg); diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h index 3711981f78..a880a7a939 100644 --- a/src/dbus/qdbusconnection.h +++ b/src/dbus/qdbusconnection.h @@ -132,13 +132,13 @@ public: explicit QDBusConnection(const QString &name); QDBusConnection(const QDBusConnection &other); #ifdef Q_COMPILER_RVALUE_REFS - QDBusConnection(QDBusConnection &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; } - QDBusConnection &operator=(QDBusConnection &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDBusConnection(QDBusConnection &&other) noexcept : d(other.d) { other.d = nullptr; } + QDBusConnection &operator=(QDBusConnection &&other) noexcept { swap(other); return *this; } #endif QDBusConnection &operator=(const QDBusConnection &other); ~QDBusConnection(); - void swap(QDBusConnection &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QDBusConnection &other) noexcept { qSwap(d, other.d); } bool isConnected() const; QString baseService() const; diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h index c264f62b7d..5a68a417c4 100644 --- a/src/dbus/qdbuserror.h +++ b/src/dbus/qdbuserror.h @@ -99,17 +99,17 @@ public: QDBusError(ErrorType error, const QString &message); QDBusError(const QDBusError &other); #ifdef Q_COMPILER_RVALUE_REFS - QDBusError(QDBusError &&other) Q_DECL_NOTHROW + QDBusError(QDBusError &&other) noexcept : code(other.code), msg(std::move(other.msg)), nm(std::move(other.nm)) {} - QDBusError &operator=(QDBusError &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDBusError &operator=(QDBusError &&other) noexcept { swap(other); return *this; } #endif QDBusError &operator=(const QDBusError &other); #ifndef QT_BOOTSTRAPPED QDBusError &operator=(const QDBusMessage &msg); #endif - void swap(QDBusError &other) Q_DECL_NOTHROW + void swap(QDBusError &other) noexcept { qSwap(code, other.code); qSwap(msg, other.msg); diff --git a/src/dbus/qdbusextratypes.h b/src/dbus/qdbusextratypes.h index 12961e2702..e2430ad6f2 100644 --- a/src/dbus/qdbusextratypes.h +++ b/src/dbus/qdbusextratypes.h @@ -59,7 +59,7 @@ class Q_DBUS_EXPORT QDBusObjectPath { QString m_path; public: - QDBusObjectPath() Q_DECL_NOTHROW : m_path() {} + QDBusObjectPath() noexcept : m_path() {} // compiler-generated copy/move constructor/assignment operators are ok! // compiler-generated destructor is ok! @@ -70,7 +70,7 @@ public: explicit QDBusObjectPath(QString &&p) : m_path(std::move(p)) { doCheck(); } #endif - void swap(QDBusObjectPath &other) Q_DECL_NOTHROW { qSwap(m_path, other.m_path); } + void swap(QDBusObjectPath &other) noexcept { qSwap(m_path, other.m_path); } inline void setPath(const QString &path); @@ -114,7 +114,7 @@ class Q_DBUS_EXPORT QDBusSignature { QString m_signature; public: - QDBusSignature() Q_DECL_NOTHROW : m_signature() {} + QDBusSignature() noexcept : m_signature() {} // compiler-generated copy/move constructor/assignment operators are ok! // compiler-generated destructor is ok! @@ -125,7 +125,7 @@ public: explicit QDBusSignature(QString &&sig) : m_signature(std::move(sig)) { doCheck(); } #endif - void swap(QDBusSignature &other) Q_DECL_NOTHROW { qSwap(m_signature, other.m_signature); } + void swap(QDBusSignature &other) noexcept { qSwap(m_signature, other.m_signature); } inline void setSignature(const QString &signature); @@ -168,16 +168,16 @@ class QDBusVariant { QVariant m_variant; public: - QDBusVariant() Q_DECL_NOTHROW : m_variant() {} + QDBusVariant() noexcept : m_variant() {} // compiler-generated copy/move constructor/assignment operators are ok! // compiler-generated destructor is ok! inline explicit QDBusVariant(const QVariant &variant); #ifdef Q_COMPILER_RVALUE_REFS - explicit QDBusVariant(QVariant &&v) Q_DECL_NOTHROW : m_variant(std::move(v)) {} + explicit QDBusVariant(QVariant &&v) noexcept : m_variant(std::move(v)) {} #endif - void swap(QDBusVariant &other) Q_DECL_NOTHROW { qSwap(m_variant, other.m_variant); } + void swap(QDBusVariant &other) noexcept { qSwap(m_variant, other.m_variant); } inline void setVariant(const QVariant &variant); diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h index 0f7e00fde0..a6f7651c73 100644 --- a/src/dbus/qdbusintegrator_p.h +++ b/src/dbus/qdbusintegrator_p.h @@ -86,7 +86,7 @@ struct QDBusSlotCache int slotIdx; QVector metaTypes; - void swap(Data &other) Q_DECL_NOTHROW + void swap(Data &other) noexcept { qSwap(flags, other.flags); qSwap(slotIdx, other.slotIdx); @@ -96,7 +96,7 @@ struct QDBusSlotCache typedef QMultiHash Hash; Hash hash; - void swap(QDBusSlotCache &other) Q_DECL_NOTHROW { qSwap(hash, other.hash); } + void swap(QDBusSlotCache &other) noexcept { qSwap(hash, other.hash); } }; Q_DECLARE_SHARED(QDBusSlotCache::Data) Q_DECLARE_SHARED(QDBusSlotCache) diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h index 23e04045d8..3e73db70de 100644 --- a/src/dbus/qdbusmessage.h +++ b/src/dbus/qdbusmessage.h @@ -69,12 +69,12 @@ public: QDBusMessage(); QDBusMessage(const QDBusMessage &other); #ifdef Q_COMPILER_RVALUE_REFS - QDBusMessage &operator=(QDBusMessage &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDBusMessage &operator=(QDBusMessage &&other) noexcept { swap(other); return *this; } #endif QDBusMessage &operator=(const QDBusMessage &other); ~QDBusMessage(); - void swap(QDBusMessage &other) Q_DECL_NOTHROW { qSwap(d_ptr, other.d_ptr); } + void swap(QDBusMessage &other) noexcept { qSwap(d_ptr, other.d_ptr); } static QDBusMessage createSignal(const QString &path, const QString &interface, const QString &name); diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h index 24b1d6a7ca..c521b7d163 100644 --- a/src/dbus/qdbuspendingcall.h +++ b/src/dbus/qdbuspendingcall.h @@ -61,11 +61,11 @@ public: QDBusPendingCall(const QDBusPendingCall &other); ~QDBusPendingCall(); #ifdef Q_COMPILER_RVALUE_REFS - QDBusPendingCall &operator=(QDBusPendingCall &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDBusPendingCall &operator=(QDBusPendingCall &&other) noexcept { swap(other); return *this; } #endif QDBusPendingCall &operator=(const QDBusPendingCall &other); - void swap(QDBusPendingCall &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QDBusPendingCall &other) noexcept { qSwap(d, other.d); } #ifndef Q_CLANG_QDOC // pretend that they aren't here diff --git a/src/dbus/qdbusunixfiledescriptor.h b/src/dbus/qdbusunixfiledescriptor.h index ed3209ceda..6b264a6b86 100644 --- a/src/dbus/qdbusunixfiledescriptor.h +++ b/src/dbus/qdbusunixfiledescriptor.h @@ -62,12 +62,12 @@ public: explicit QDBusUnixFileDescriptor(int fileDescriptor); QDBusUnixFileDescriptor(const QDBusUnixFileDescriptor &other); #if defined(Q_COMPILER_RVALUE_REFS) - QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other) noexcept { swap(other); return *this; } #endif QDBusUnixFileDescriptor &operator=(const QDBusUnixFileDescriptor &other); ~QDBusUnixFileDescriptor(); - void swap(QDBusUnixFileDescriptor &other) Q_DECL_NOTHROW + void swap(QDBusUnixFileDescriptor &other) noexcept { qSwap(d, other.d); } bool isValid() const; diff --git a/src/network/access/qabstractnetworkcache.h b/src/network/access/qabstractnetworkcache.h index 678bae2d6e..b604323c41 100644 --- a/src/network/access/qabstractnetworkcache.h +++ b/src/network/access/qabstractnetworkcache.h @@ -68,11 +68,11 @@ public: ~QNetworkCacheMetaData(); #ifdef Q_COMPILER_RVALUE_REFS - QNetworkCacheMetaData &operator=(QNetworkCacheMetaData &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QNetworkCacheMetaData &operator=(QNetworkCacheMetaData &&other) noexcept { swap(other); return *this; } #endif QNetworkCacheMetaData &operator=(const QNetworkCacheMetaData &other); - void swap(QNetworkCacheMetaData &other) Q_DECL_NOTHROW + void swap(QNetworkCacheMetaData &other) noexcept { qSwap(d, other.d); } bool operator==(const QNetworkCacheMetaData &other) const; diff --git a/src/network/access/qhstspolicy.h b/src/network/access/qhstspolicy.h index 176a8fa635..f1b2ee99e5 100644 --- a/src/network/access/qhstspolicy.h +++ b/src/network/access/qhstspolicy.h @@ -65,10 +65,10 @@ public: QUrl::ParsingMode mode = QUrl::DecodedMode); QHstsPolicy(const QHstsPolicy &rhs); QHstsPolicy &operator=(const QHstsPolicy &rhs); - QHstsPolicy &operator=(QHstsPolicy &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QHstsPolicy &operator=(QHstsPolicy &&other) noexcept { swap(other); return *this; } ~QHstsPolicy(); - void swap(QHstsPolicy &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QHstsPolicy &other) noexcept { qSwap(d, other.d); } void setHost(const QString &host, QUrl::ParsingMode mode = QUrl::DecodedMode); QString host(QUrl::ComponentFormattingOptions options = QUrl::FullyDecoded) const; diff --git a/src/network/access/qhttpmultipart.h b/src/network/access/qhttpmultipart.h index 78585a704d..f718d51d0c 100644 --- a/src/network/access/qhttpmultipart.h +++ b/src/network/access/qhttpmultipart.h @@ -61,11 +61,11 @@ public: QHttpPart(const QHttpPart &other); ~QHttpPart(); #ifdef Q_COMPILER_RVALUE_REFS - QHttpPart &operator=(QHttpPart &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QHttpPart &operator=(QHttpPart &&other) noexcept { swap(other); return *this; } #endif QHttpPart &operator=(const QHttpPart &other); - void swap(QHttpPart &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QHttpPart &other) noexcept { qSwap(d, other.d); } bool operator==(const QHttpPart &other) const; inline bool operator!=(const QHttpPart &other) const diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h index e462b98555..58c504f9ae 100644 --- a/src/network/access/qnetworkcookie.h +++ b/src/network/access/qnetworkcookie.h @@ -67,11 +67,11 @@ public: QNetworkCookie(const QNetworkCookie &other); ~QNetworkCookie(); #ifdef Q_COMPILER_RVALUE_REFS - QNetworkCookie &operator=(QNetworkCookie &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QNetworkCookie &operator=(QNetworkCookie &&other) noexcept { swap(other); return *this; } #endif QNetworkCookie &operator=(const QNetworkCookie &other); - void swap(QNetworkCookie &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QNetworkCookie &other) noexcept { qSwap(d, other.d); } bool operator==(const QNetworkCookie &other) const; inline bool operator!=(const QNetworkCookie &other) const diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index efb9cbecba..2515ff6ead 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -131,11 +131,11 @@ public: QNetworkRequest(const QNetworkRequest &other); ~QNetworkRequest(); #ifdef Q_COMPILER_RVALUE_REFS - QNetworkRequest &operator=(QNetworkRequest &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QNetworkRequest &operator=(QNetworkRequest &&other) noexcept { swap(other); return *this; } #endif QNetworkRequest &operator=(const QNetworkRequest &other); - void swap(QNetworkRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QNetworkRequest &other) noexcept { qSwap(d, other.d); } bool operator==(const QNetworkRequest &other) const; inline bool operator!=(const QNetworkRequest &other) const diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h index e7b74034fc..41b6e6f020 100644 --- a/src/network/bearer/qnetworkconfiguration.h +++ b/src/network/bearer/qnetworkconfiguration.h @@ -56,12 +56,12 @@ public: QNetworkConfiguration(); QNetworkConfiguration(const QNetworkConfiguration& other); #ifdef Q_COMPILER_RVALUE_REFS - QNetworkConfiguration &operator=(QNetworkConfiguration &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QNetworkConfiguration &operator=(QNetworkConfiguration &&other) noexcept { swap(other); return *this; } #endif QNetworkConfiguration &operator=(const QNetworkConfiguration &other); ~QNetworkConfiguration(); - void swap(QNetworkConfiguration &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QNetworkConfiguration &other) noexcept { qSwap(d, other.d); } bool operator==(const QNetworkConfiguration &other) const; inline bool operator!=(const QNetworkConfiguration &other) const diff --git a/src/network/kernel/qdnslookup.h b/src/network/kernel/qdnslookup.h index eebd0abe66..79a476b98f 100644 --- a/src/network/kernel/qdnslookup.h +++ b/src/network/kernel/qdnslookup.h @@ -65,12 +65,12 @@ public: QDnsDomainNameRecord(); QDnsDomainNameRecord(const QDnsDomainNameRecord &other); #ifdef Q_COMPILER_RVALUE_REFS - QDnsDomainNameRecord &operator=(QDnsDomainNameRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDnsDomainNameRecord &operator=(QDnsDomainNameRecord &&other) noexcept { swap(other); return *this; } #endif QDnsDomainNameRecord &operator=(const QDnsDomainNameRecord &other); ~QDnsDomainNameRecord(); - void swap(QDnsDomainNameRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QDnsDomainNameRecord &other) noexcept { qSwap(d, other.d); } QString name() const; quint32 timeToLive() const; @@ -89,12 +89,12 @@ public: QDnsHostAddressRecord(); QDnsHostAddressRecord(const QDnsHostAddressRecord &other); #ifdef Q_COMPILER_RVALUE_REFS - QDnsHostAddressRecord &operator=(QDnsHostAddressRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDnsHostAddressRecord &operator=(QDnsHostAddressRecord &&other) noexcept { swap(other); return *this; } #endif QDnsHostAddressRecord &operator=(const QDnsHostAddressRecord &other); ~QDnsHostAddressRecord(); - void swap(QDnsHostAddressRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QDnsHostAddressRecord &other) noexcept { qSwap(d, other.d); } QString name() const; quint32 timeToLive() const; @@ -113,12 +113,12 @@ public: QDnsMailExchangeRecord(); QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other); #ifdef Q_COMPILER_RVALUE_REFS - QDnsMailExchangeRecord &operator=(QDnsMailExchangeRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDnsMailExchangeRecord &operator=(QDnsMailExchangeRecord &&other) noexcept { swap(other); return *this; } #endif QDnsMailExchangeRecord &operator=(const QDnsMailExchangeRecord &other); ~QDnsMailExchangeRecord(); - void swap(QDnsMailExchangeRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QDnsMailExchangeRecord &other) noexcept { qSwap(d, other.d); } QString exchange() const; QString name() const; @@ -138,12 +138,12 @@ public: QDnsServiceRecord(); QDnsServiceRecord(const QDnsServiceRecord &other); #ifdef Q_COMPILER_RVALUE_REFS - QDnsServiceRecord &operator=(QDnsServiceRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDnsServiceRecord &operator=(QDnsServiceRecord &&other) noexcept { swap(other); return *this; } #endif QDnsServiceRecord &operator=(const QDnsServiceRecord &other); ~QDnsServiceRecord(); - void swap(QDnsServiceRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QDnsServiceRecord &other) noexcept { qSwap(d, other.d); } QString name() const; quint16 port() const; @@ -165,12 +165,12 @@ public: QDnsTextRecord(); QDnsTextRecord(const QDnsTextRecord &other); #ifdef Q_COMPILER_RVALUE_REFS - QDnsTextRecord &operator=(QDnsTextRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QDnsTextRecord &operator=(QDnsTextRecord &&other) noexcept { swap(other); return *this; } #endif QDnsTextRecord &operator=(const QDnsTextRecord &other); ~QDnsTextRecord(); - void swap(QDnsTextRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QDnsTextRecord &other) noexcept { qSwap(d, other.d); } QString name() const; quint32 timeToLive() const; diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index fba91c62c8..644f4336ca 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -1333,7 +1333,7 @@ QDebug operator<<(QDebug d, const QHostAddress &address) \relates QHostAddress Returns a hash of the host address \a key, using \a seed to seed the calculation. */ -uint qHash(const QHostAddress &key, uint seed) Q_DECL_NOTHROW +uint qHash(const QHostAddress &key, uint seed) noexcept { return qHashBits(key.d->a6.c, 16, seed); } diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h index 00555f3d8e..f20da3304f 100644 --- a/src/network/kernel/qhostaddress.h +++ b/src/network/kernel/qhostaddress.h @@ -66,7 +66,7 @@ typedef QIPv6Address Q_IPV6ADDR; class QHostAddress; // qHash is a friend, but we can't use default arguments for friends (§8.3.6.4) -Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0) Q_DECL_NOTHROW; +Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0) noexcept; class Q_NETWORK_EXPORT QHostAddress { @@ -103,7 +103,7 @@ public: ~QHostAddress(); #ifdef Q_COMPILER_RVALUE_REFS - QHostAddress &operator=(QHostAddress &&other) Q_DECL_NOTHROW + QHostAddress &operator=(QHostAddress &&other) noexcept { swap(other); return *this; } #endif @@ -114,7 +114,7 @@ public: #endif QHostAddress &operator=(SpecialAddress address); - void swap(QHostAddress &other) Q_DECL_NOTHROW { d.swap(other.d); } + void swap(QHostAddress &other) noexcept { d.swap(other.d); } void setAddress(quint32 ip4Addr); void setAddress(quint8 *ip6Addr); // ### Qt 6: remove me @@ -157,7 +157,7 @@ public: static QPair parseSubnet(const QString &subnet); - friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed) Q_DECL_NOTHROW; + friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed) noexcept; protected: friend class QHostAddressPrivate; QExplicitlySharedDataPointer d; diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 1c7a8da06d..71d1aae35a 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -64,8 +64,8 @@ Q_GLOBAL_STATIC(QHostInfoLookupManager, theHostInfoLookupManager) namespace { struct ToBeLookedUpEquals { typedef bool result_type; - explicit ToBeLookedUpEquals(const QString &toBeLookedUp) Q_DECL_NOTHROW : m_toBeLookedUp(toBeLookedUp) {} - result_type operator()(QHostInfoRunnable* lookup) const Q_DECL_NOTHROW + explicit ToBeLookedUpEquals(const QString &toBeLookedUp) noexcept : m_toBeLookedUp(toBeLookedUp) {} + result_type operator()(QHostInfoRunnable* lookup) const noexcept { return m_toBeLookedUp == lookup->toBeLookedUp; } diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h index 49871ad470..dc31cc08e4 100644 --- a/src/network/kernel/qhostinfo.h +++ b/src/network/kernel/qhostinfo.h @@ -63,10 +63,10 @@ public: explicit QHostInfo(int lookupId = -1); QHostInfo(const QHostInfo &d); QHostInfo &operator=(const QHostInfo &d); - QHostInfo &operator=(QHostInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QHostInfo &operator=(QHostInfo &&other) noexcept { swap(other); return *this; } ~QHostInfo(); - void swap(QHostInfo &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QHostInfo &other) noexcept { qSwap(d, other.d); } QString hostName() const; void setHostName(const QString &name); diff --git a/src/network/kernel/qnetworkdatagram.h b/src/network/kernel/qnetworkdatagram.h index 1acb44a1e0..70958fea42 100644 --- a/src/network/kernel/qnetworkdatagram.h +++ b/src/network/kernel/qnetworkdatagram.h @@ -61,13 +61,13 @@ public: ~QNetworkDatagram() { if (d) destroy(d); } - QNetworkDatagram(QNetworkDatagram &&other) Q_DECL_NOTHROW + QNetworkDatagram(QNetworkDatagram &&other) noexcept : d(other.d) { other.d = nullptr; } - QNetworkDatagram &operator=(QNetworkDatagram &&other) Q_DECL_NOTHROW + QNetworkDatagram &operator=(QNetworkDatagram &&other) noexcept { swap(other); return *this; } - void swap(QNetworkDatagram &other) Q_DECL_NOTHROW + void swap(QNetworkDatagram &other) noexcept { qSwap(d, other.d); } void clear(); diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index 148fd5e10d..1d3286118e 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -65,12 +65,12 @@ public: QNetworkAddressEntry(); QNetworkAddressEntry(const QNetworkAddressEntry &other); #ifdef Q_COMPILER_RVALUE_REFS - QNetworkAddressEntry &operator=(QNetworkAddressEntry &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QNetworkAddressEntry &operator=(QNetworkAddressEntry &&other) noexcept { swap(other); return *this; } #endif QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other); ~QNetworkAddressEntry(); - void swap(QNetworkAddressEntry &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QNetworkAddressEntry &other) noexcept { qSwap(d, other.d); } bool operator==(const QNetworkAddressEntry &other) const; inline bool operator!=(const QNetworkAddressEntry &other) const @@ -143,12 +143,12 @@ public: QNetworkInterface(); QNetworkInterface(const QNetworkInterface &other); #ifdef Q_COMPILER_RVALUE_REFS - QNetworkInterface &operator=(QNetworkInterface &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QNetworkInterface &operator=(QNetworkInterface &&other) noexcept { swap(other); return *this; } #endif QNetworkInterface &operator=(const QNetworkInterface &other); ~QNetworkInterface(); - void swap(QNetworkInterface &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QNetworkInterface &other) noexcept { qSwap(d, other.d); } bool isValid() const; diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h index 7e3e6906a8..0b1bc02695 100644 --- a/src/network/kernel/qnetworkproxy.h +++ b/src/network/kernel/qnetworkproxy.h @@ -90,12 +90,12 @@ public: #endif QNetworkProxyQuery(const QNetworkProxyQuery &other); #ifdef Q_COMPILER_RVALUE_REFS - QNetworkProxyQuery &operator=(QNetworkProxyQuery &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QNetworkProxyQuery &operator=(QNetworkProxyQuery &&other) noexcept { swap(other); return *this; } #endif QNetworkProxyQuery &operator=(const QNetworkProxyQuery &other); ~QNetworkProxyQuery(); - void swap(QNetworkProxyQuery &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QNetworkProxyQuery &other) noexcept { qSwap(d, other.d); } bool operator==(const QNetworkProxyQuery &other) const; inline bool operator!=(const QNetworkProxyQuery &other) const @@ -162,12 +162,12 @@ public: const QString &user = QString(), const QString &password = QString()); QNetworkProxy(const QNetworkProxy &other); #ifdef Q_COMPILER_RVALUE_REFS - QNetworkProxy &operator=(QNetworkProxy &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QNetworkProxy &operator=(QNetworkProxy &&other) noexcept { swap(other); return *this; } #endif QNetworkProxy &operator=(const QNetworkProxy &other); ~QNetworkProxy(); - void swap(QNetworkProxy &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QNetworkProxy &other) noexcept { qSwap(d, other.d); } bool operator==(const QNetworkProxy &other) const; inline bool operator!=(const QNetworkProxy &other) const diff --git a/src/network/ssl/qocspresponse.cpp b/src/network/ssl/qocspresponse.cpp index d564e817ca..79f0cfd1d4 100644 --- a/src/network/ssl/qocspresponse.cpp +++ b/src/network/ssl/qocspresponse.cpp @@ -133,7 +133,7 @@ QOcspResponse::QOcspResponse(const QOcspResponse &) = default; Move-constructs a QOcspResponse instance. */ -QOcspResponse::QOcspResponse(QOcspResponse &&) Q_DECL_NOTHROW = default; +QOcspResponse::QOcspResponse(QOcspResponse &&) noexcept = default; /*! \since 5.13 @@ -154,7 +154,7 @@ QOcspResponse &QOcspResponse::operator=(const QOcspResponse &) = default; Move-assigns to this QOcspResponse instance. */ -QOcspResponse &QOcspResponse::operator=(QOcspResponse &&) Q_DECL_NOTHROW = default; +QOcspResponse &QOcspResponse::operator=(QOcspResponse &&) noexcept = default; /*! \fn void QOcspResponse::swap(QOcspResponse &other) diff --git a/src/network/ssl/qocspresponse.h b/src/network/ssl/qocspresponse.h index 552a088ba5..0e134d236b 100644 --- a/src/network/ssl/qocspresponse.h +++ b/src/network/ssl/qocspresponse.h @@ -82,11 +82,11 @@ public: QOcspResponse(); QOcspResponse(const QOcspResponse &other); - QOcspResponse(QOcspResponse && other) Q_DECL_NOEXCEPT; + QOcspResponse(QOcspResponse && other) noexcept; ~QOcspResponse(); QOcspResponse &operator = (const QOcspResponse &other); - QOcspResponse &operator = (QOcspResponse &&other) Q_DECL_NOTHROW; + QOcspResponse &operator = (QOcspResponse &&other) noexcept; QOcspCertificateStatus certificateStatus() const; QOcspRevocationReason revocationReason() const; @@ -94,7 +94,7 @@ public: class QSslCertificate responder() const; QSslCertificate subject() const; - void swap(QOcspResponse &other) Q_DECL_NOTHROW { d.swap(other.d); } + void swap(QOcspResponse &other) noexcept { d.swap(other.d); } private: diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h index 266fcdacb4..a6acfa2cc3 100644 --- a/src/network/ssl/qsslcertificate.h +++ b/src/network/ssl/qsslcertificate.h @@ -66,7 +66,7 @@ class QStringList; class QSslCertificate; // qHash is a friend, but we can't use default arguments for friends (§8.3.6.4) -Q_NETWORK_EXPORT uint qHash(const QSslCertificate &key, uint seed = 0) Q_DECL_NOTHROW; +Q_NETWORK_EXPORT uint qHash(const QSslCertificate &key, uint seed = 0) noexcept; class QSslCertificatePrivate; class Q_NETWORK_EXPORT QSslCertificate @@ -89,11 +89,11 @@ public: QSslCertificate(const QSslCertificate &other); ~QSslCertificate(); #ifdef Q_COMPILER_RVALUE_REFS - QSslCertificate &operator=(QSslCertificate &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSslCertificate &operator=(QSslCertificate &&other) noexcept { swap(other); return *this; } #endif QSslCertificate &operator=(const QSslCertificate &other); - void swap(QSslCertificate &other) Q_DECL_NOTHROW + void swap(QSslCertificate &other) noexcept { qSwap(d, other.d); } bool operator==(const QSslCertificate &other) const; @@ -169,7 +169,7 @@ private: friend class QSslCertificatePrivate; friend class QSslSocketBackendPrivate; - friend Q_NETWORK_EXPORT uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW; + friend Q_NETWORK_EXPORT uint qHash(const QSslCertificate &key, uint seed) noexcept; }; Q_DECLARE_SHARED(QSslCertificate) diff --git a/src/network/ssl/qsslcertificate_openssl.cpp b/src/network/ssl/qsslcertificate_openssl.cpp index 899c8a0d2d..806c6426e4 100644 --- a/src/network/ssl/qsslcertificate_openssl.cpp +++ b/src/network/ssl/qsslcertificate_openssl.cpp @@ -65,7 +65,7 @@ bool QSslCertificate::operator==(const QSslCertificate &other) const return false; } -uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW +uint qHash(const QSslCertificate &key, uint seed) noexcept { if (X509 * const x509 = key.d->x509) { const EVP_MD *sha1 = q_EVP_sha1(); diff --git a/src/network/ssl/qsslcertificate_qt.cpp b/src/network/ssl/qsslcertificate_qt.cpp index cce59b5ef3..8b5035ad96 100644 --- a/src/network/ssl/qsslcertificate_qt.cpp +++ b/src/network/ssl/qsslcertificate_qt.cpp @@ -64,7 +64,7 @@ bool QSslCertificate::operator==(const QSslCertificate &other) const return d->derData == other.d->derData; } -uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW +uint qHash(const QSslCertificate &key, uint seed) noexcept { // DER is the native encoding here, so toDer() is just "return d->derData": return qHash(key.toDer(), seed); diff --git a/src/network/ssl/qsslcertificateextension.h b/src/network/ssl/qsslcertificateextension.h index c2910e1707..f862015312 100644 --- a/src/network/ssl/qsslcertificateextension.h +++ b/src/network/ssl/qsslcertificateextension.h @@ -56,12 +56,12 @@ public: QSslCertificateExtension(); QSslCertificateExtension(const QSslCertificateExtension &other); #ifdef Q_COMPILER_RVALUE_REFS - QSslCertificateExtension &operator=(QSslCertificateExtension &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSslCertificateExtension &operator=(QSslCertificateExtension &&other) noexcept { swap(other); return *this; } #endif QSslCertificateExtension &operator=(const QSslCertificateExtension &other); ~QSslCertificateExtension(); - void swap(QSslCertificateExtension &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QSslCertificateExtension &other) noexcept { qSwap(d, other.d); } QString oid() const; QString name() const; diff --git a/src/network/ssl/qsslcipher.h b/src/network/ssl/qsslcipher.h index c6328e0169..430fe9aa7c 100644 --- a/src/network/ssl/qsslcipher.h +++ b/src/network/ssl/qsslcipher.h @@ -60,12 +60,12 @@ public: QSslCipher(const QString &name, QSsl::SslProtocol protocol); QSslCipher(const QSslCipher &other); #ifdef Q_COMPILER_RVALUE_REFS - QSslCipher &operator=(QSslCipher &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSslCipher &operator=(QSslCipher &&other) noexcept { swap(other); return *this; } #endif QSslCipher &operator=(const QSslCipher &other); ~QSslCipher(); - void swap(QSslCipher &other) Q_DECL_NOTHROW + void swap(QSslCipher &other) noexcept { qSwap(d, other.d); } bool operator==(const QSslCipher &other) const; diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h index 8f53e25a53..16704ba17b 100644 --- a/src/network/ssl/qsslconfiguration.h +++ b/src/network/ssl/qsslconfiguration.h @@ -86,11 +86,11 @@ public: QSslConfiguration(const QSslConfiguration &other); ~QSslConfiguration(); #ifdef Q_COMPILER_RVALUE_REFS - QSslConfiguration &operator=(QSslConfiguration &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSslConfiguration &operator=(QSslConfiguration &&other) noexcept { swap(other); return *this; } #endif QSslConfiguration &operator=(const QSslConfiguration &other); - void swap(QSslConfiguration &other) Q_DECL_NOTHROW + void swap(QSslConfiguration &other) noexcept { qSwap(d, other.d); } bool operator==(const QSslConfiguration &other) const; diff --git a/src/network/ssl/qssldiffiehellmanparameters.cpp b/src/network/ssl/qssldiffiehellmanparameters.cpp index 65041d4456..7807afaa30 100644 --- a/src/network/ssl/qssldiffiehellmanparameters.cpp +++ b/src/network/ssl/qssldiffiehellmanparameters.cpp @@ -213,7 +213,7 @@ QSslDiffieHellmanParameters &QSslDiffieHellmanParameters::operator=(const QSslDi Setting an empty QSslDiffieHellmanParameters instance on a QSslSocket-based server will disable Diffie-Hellman key exchange. */ -bool QSslDiffieHellmanParameters::isEmpty() const Q_DECL_NOTHROW +bool QSslDiffieHellmanParameters::isEmpty() const noexcept { return d->derData.isNull() && d->error == QSslDiffieHellmanParameters::NoError; } @@ -229,7 +229,7 @@ bool QSslDiffieHellmanParameters::isEmpty() const Q_DECL_NOTHROW \sa error() */ -bool QSslDiffieHellmanParameters::isValid() const Q_DECL_NOTHROW +bool QSslDiffieHellmanParameters::isValid() const noexcept { return d->error == QSslDiffieHellmanParameters::NoError; } @@ -253,7 +253,7 @@ bool QSslDiffieHellmanParameters::isValid() const Q_DECL_NOTHROW Returns the error that caused the QSslDiffieHellmanParameters object to be invalid. */ -QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error() const Q_DECL_NOTHROW +QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error() const noexcept { return d->error; } @@ -262,7 +262,7 @@ QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error() const Q_ Returns a human-readable description of the error that caused the QSslDiffieHellmanParameters object to be invalid. */ -QString QSslDiffieHellmanParameters::errorString() const Q_DECL_NOTHROW +QString QSslDiffieHellmanParameters::errorString() const noexcept { switch (d->error) { case QSslDiffieHellmanParameters::NoError: @@ -283,7 +283,7 @@ QString QSslDiffieHellmanParameters::errorString() const Q_DECL_NOTHROW Returns \c true if \a lhs is equal to \a rhs; otherwise returns \c false. */ -bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW +bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept { return lhs.d->derData == rhs.d->derData; } @@ -316,7 +316,7 @@ QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam) Returns an hash value for \a dhparam, using \a seed to seed the calculation. */ -uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed) Q_DECL_NOTHROW +uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed) noexcept { return qHash(dhparam.d->derData, seed); } diff --git a/src/network/ssl/qssldiffiehellmanparameters.h b/src/network/ssl/qssldiffiehellmanparameters.h index 497d2bebfb..f62a3b8f44 100644 --- a/src/network/ssl/qssldiffiehellmanparameters.h +++ b/src/network/ssl/qssldiffiehellmanparameters.h @@ -56,16 +56,16 @@ class QSslDiffieHellmanParametersPrivate; class QSslDiffieHellmanParameters; // qHash is a friend, but we can't use default arguments for friends (§8.3.6.4) -Q_NETWORK_EXPORT uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed = 0) Q_DECL_NOTHROW; +Q_NETWORK_EXPORT uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed = 0) noexcept; #ifndef QT_NO_DEBUG_STREAM class QDebug; Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparams); #endif -Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW; +Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept; -inline bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW +inline bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept { return !operator==(lhs, rhs); } @@ -83,30 +83,30 @@ public: Q_NETWORK_EXPORT QSslDiffieHellmanParameters(); Q_NETWORK_EXPORT QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other); - QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; } + QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other) noexcept : d(other.d) { other.d = nullptr; } Q_NETWORK_EXPORT ~QSslDiffieHellmanParameters(); Q_NETWORK_EXPORT QSslDiffieHellmanParameters &operator=(const QSslDiffieHellmanParameters &other); - QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other) noexcept { swap(other); return *this; } - void swap(QSslDiffieHellmanParameters &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QSslDiffieHellmanParameters &other) noexcept { qSwap(d, other.d); } Q_NETWORK_EXPORT static QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat format = QSsl::Pem); Q_NETWORK_EXPORT static QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem); - Q_NETWORK_EXPORT bool isEmpty() const Q_DECL_NOTHROW; - Q_NETWORK_EXPORT bool isValid() const Q_DECL_NOTHROW; - Q_NETWORK_EXPORT Error error() const Q_DECL_NOTHROW; - Q_NETWORK_EXPORT QString errorString() const Q_DECL_NOTHROW; + Q_NETWORK_EXPORT bool isEmpty() const noexcept; + Q_NETWORK_EXPORT bool isValid() const noexcept; + Q_NETWORK_EXPORT Error error() const noexcept; + Q_NETWORK_EXPORT QString errorString() const noexcept; private: QSslDiffieHellmanParametersPrivate *d; friend class QSslContext; - friend Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW; + friend Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept; #ifndef QT_NO_DEBUG_STREAM friend Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam); #endif - friend Q_NETWORK_EXPORT uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed) Q_DECL_NOTHROW; + friend Q_NETWORK_EXPORT uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed) noexcept; }; Q_DECLARE_SHARED(QSslDiffieHellmanParameters) diff --git a/src/network/ssl/qsslellipticcurve.h b/src/network/ssl/qsslellipticcurve.h index 57dda19bad..28de3a03b4 100644 --- a/src/network/ssl/qsslellipticcurve.h +++ b/src/network/ssl/qsslellipticcurve.h @@ -52,11 +52,11 @@ QT_BEGIN_NAMESPACE class QSslEllipticCurve; // qHash is a friend, but we can't use default arguments for friends (§8.3.6.4) -Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed = 0) Q_DECL_NOTHROW; +Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed = 0) noexcept; class QSslEllipticCurve { public: - Q_DECL_CONSTEXPR QSslEllipticCurve() Q_DECL_NOTHROW + Q_DECL_CONSTEXPR QSslEllipticCurve() noexcept : id(0) { } @@ -67,18 +67,18 @@ public: Q_REQUIRED_RESULT Q_NETWORK_EXPORT QString shortName() const; Q_REQUIRED_RESULT Q_NETWORK_EXPORT QString longName() const; - Q_DECL_CONSTEXPR bool isValid() const Q_DECL_NOTHROW + Q_DECL_CONSTEXPR bool isValid() const noexcept { return id != 0; } - Q_NETWORK_EXPORT bool isTlsNamedCurve() const Q_DECL_NOTHROW; + Q_NETWORK_EXPORT bool isTlsNamedCurve() const noexcept; private: int id; - friend Q_DECL_CONSTEXPR bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW; - friend Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW; + friend Q_DECL_CONSTEXPR bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept; + friend Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed) noexcept; friend class QSslContext; friend class QSslSocketPrivate; @@ -87,13 +87,13 @@ private: Q_DECLARE_TYPEINFO(QSslEllipticCurve, Q_PRIMITIVE_TYPE); -Q_DECL_CONSTEXPR inline uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW +Q_DECL_CONSTEXPR inline uint qHash(QSslEllipticCurve curve, uint seed) noexcept { return qHash(curve.id, seed); } -Q_DECL_CONSTEXPR inline bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW +Q_DECL_CONSTEXPR inline bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept { return lhs.id == rhs.id; } -Q_DECL_CONSTEXPR inline bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW +Q_DECL_CONSTEXPR inline bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept { return !operator==(lhs, rhs); } #ifndef QT_NO_DEBUG_STREAM diff --git a/src/network/ssl/qsslellipticcurve_dummy.cpp b/src/network/ssl/qsslellipticcurve_dummy.cpp index 93e081b9e0..1313e06875 100644 --- a/src/network/ssl/qsslellipticcurve_dummy.cpp +++ b/src/network/ssl/qsslellipticcurve_dummy.cpp @@ -63,7 +63,7 @@ QSslEllipticCurve QSslEllipticCurve::fromLongName(const QString &name) return QSslEllipticCurve(); } -bool QSslEllipticCurve::isTlsNamedCurve() const Q_DECL_NOTHROW +bool QSslEllipticCurve::isTlsNamedCurve() const noexcept { return false; } diff --git a/src/network/ssl/qsslellipticcurve_openssl.cpp b/src/network/ssl/qsslellipticcurve_openssl.cpp index 8cd14837f0..b5e38ada53 100644 --- a/src/network/ssl/qsslellipticcurve_openssl.cpp +++ b/src/network/ssl/qsslellipticcurve_openssl.cpp @@ -170,7 +170,7 @@ static const int tlsNamedCurveNIDs[] = { static const size_t tlsNamedCurveNIDCount = sizeof(tlsNamedCurveNIDs) / sizeof(tlsNamedCurveNIDs[0]); -bool QSslEllipticCurve::isTlsNamedCurve() const Q_DECL_NOTHROW +bool QSslEllipticCurve::isTlsNamedCurve() const noexcept { const int * const tlsNamedCurveNIDsEnd = tlsNamedCurveNIDs + tlsNamedCurveNIDCount; return std::find(tlsNamedCurveNIDs, tlsNamedCurveNIDsEnd, id) != tlsNamedCurveNIDsEnd; diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp index 02dd16a58d..ff54c2ad20 100644 --- a/src/network/ssl/qsslerror.cpp +++ b/src/network/ssl/qsslerror.cpp @@ -361,7 +361,7 @@ QSslCertificate QSslError::certificate() const \since 5.4 \relates QHash */ -uint qHash(const QSslError &key, uint seed) Q_DECL_NOTHROW +uint qHash(const QSslError &key, uint seed) noexcept { // 2x boost::hash_combine inlined: seed ^= qHash(key.error()) + 0x9e3779b9 + (seed << 6) + (seed >> 2); diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h index 513b8afd7f..a9c46c8571 100644 --- a/src/network/ssl/qsslerror.h +++ b/src/network/ssl/qsslerror.h @@ -103,12 +103,12 @@ public: QSslError(const QSslError &other); - void swap(QSslError &other) Q_DECL_NOTHROW + void swap(QSslError &other) noexcept { qSwap(d, other.d); } ~QSslError(); #ifdef Q_COMPILER_RVALUE_REFS - QSslError &operator=(QSslError &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSslError &operator=(QSslError &&other) noexcept { swap(other); return *this; } #endif QSslError &operator=(const QSslError &other); bool operator==(const QSslError &other) const; @@ -124,7 +124,7 @@ private: }; Q_DECLARE_SHARED(QSslError) -Q_NETWORK_EXPORT uint qHash(const QSslError &key, uint seed = 0) Q_DECL_NOTHROW; +Q_NETWORK_EXPORT uint qHash(const QSslError &key, uint seed = 0) noexcept; #ifndef QT_NO_DEBUG_STREAM class QDebug; diff --git a/src/network/ssl/qsslkey.h b/src/network/ssl/qsslkey.h index 6de02b1e44..a865f20a51 100644 --- a/src/network/ssl/qsslkey.h +++ b/src/network/ssl/qsslkey.h @@ -72,12 +72,12 @@ public: explicit QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey); QSslKey(const QSslKey &other); #ifdef Q_COMPILER_RVALUE_REFS - QSslKey &operator=(QSslKey &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSslKey &operator=(QSslKey &&other) noexcept { swap(other); return *this; } #endif QSslKey &operator=(const QSslKey &other); ~QSslKey(); - void swap(QSslKey &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QSslKey &other) noexcept { qSwap(d, other.d); } bool isNull() const; void clear(); diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.h b/src/network/ssl/qsslpresharedkeyauthenticator.h index 423f7731b4..29d647b121 100644 --- a/src/network/ssl/qsslpresharedkeyauthenticator.h +++ b/src/network/ssl/qsslpresharedkeyauthenticator.h @@ -60,10 +60,10 @@ public: Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator &operator=(const QSslPreSharedKeyAuthenticator &authenticator); #ifdef Q_COMPILER_RVALUE_REFS - QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&other) noexcept { swap(other); return *this; } #endif - void swap(QSslPreSharedKeyAuthenticator &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QSslPreSharedKeyAuthenticator &other) noexcept { qSwap(d, other.d); } Q_NETWORK_EXPORT QByteArray identityHint() const; diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp index 666613f09d..02d6586fe8 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -66,7 +66,7 @@ Q_LOGGING_CATEGORY(qLcEvdevKeyMap, "qt.qpa.input.keymap") // simple builtin US keymap #include "qevdevkeyboard_defaultmap_p.h" -void QFdContainer::reset() Q_DECL_NOTHROW +void QFdContainer::reset() noexcept { if (m_fd >= 0) qt_safe_close(m_fd); diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h index 21e6d055a0..d154c30ed5 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h @@ -134,13 +134,13 @@ class QFdContainer int m_fd; Q_DISABLE_COPY_MOVE(QFdContainer); public: - explicit QFdContainer(int fd = -1) Q_DECL_NOTHROW : m_fd(fd) {} + explicit QFdContainer(int fd = -1) noexcept : m_fd(fd) {} ~QFdContainer() { reset(); } - int get() const Q_DECL_NOTHROW { return m_fd; } + int get() const noexcept { return m_fd; } - int release() Q_DECL_NOTHROW { int result = m_fd; m_fd = -1; return result; } - void reset() Q_DECL_NOTHROW; + int release() noexcept { int result = m_fd; m_fd = -1; return result; } + void reset() noexcept; }; class QEvdevKeyboardHandler : public QObject diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h index 8495b51a5a..2e57c80def 100644 --- a/src/plugins/platforms/windows/qwindowscursor.h +++ b/src/plugins/platforms/windows/qwindowscursor.h @@ -61,7 +61,7 @@ inline bool operator==(const QWindowsPixmapCursorCacheKey &k1, const QWindowsPix return k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } -inline uint qHash(const QWindowsPixmapCursorCacheKey &k, uint seed) Q_DECL_NOTHROW +inline uint qHash(const QWindowsPixmapCursorCacheKey &k, uint seed) noexcept { return (uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } diff --git a/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h index a13a8f0483..1f7e7cf49b 100644 --- a/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h @@ -190,7 +190,7 @@ struct QX11InfoData { }; template -Q_DECL_RELAXED_CONSTEXPR inline int lowest_bit(T v) Q_DECL_NOTHROW +Q_DECL_RELAXED_CONSTEXPR inline int lowest_bit(T v) noexcept { int result = qCountTrailingZeroBits(v); return ((result >> 3) == sizeof(T)) ? -1 : result; diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.h b/src/plugins/platforms/xcb/qxcbconnection_basic.h index 3691763398..b76aba2789 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_basic.h +++ b/src/plugins/platforms/xcb/qxcbconnection_basic.h @@ -162,7 +162,7 @@ private: #define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection struct QStdFreeDeleter { - void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); } + void operator()(void *p) const noexcept { return std::free(p); } }; #define Q_XCB_REPLY(call, ...) \ diff --git a/src/plugins/platforms/xcb/qxcbcursor.h b/src/plugins/platforms/xcb/qxcbcursor.h index 488988cbe9..0b238823f0 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.h +++ b/src/plugins/platforms/xcb/qxcbcursor.h @@ -65,7 +65,7 @@ inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey; } -inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW +inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept { return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed; } diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 9fb9d6c55e..6eaf24adf9 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -398,12 +398,12 @@ static const char *ppdOriginallySelectedChoiceProperty = "_q_ppd_originally_sele // Used to store the warning label pointer for each QComboBox that represents an advanced option static const char *warningLabelProperty = "_q_warning_label"; -static bool isBlacklistedGroup(const ppd_group_t *group) Q_DECL_NOTHROW +static bool isBlacklistedGroup(const ppd_group_t *group) noexcept { return qstrcmp(group->name, "InstallableOptions") == 0; }; -static bool isBlacklistedOption(const char *keyword) Q_DECL_NOTHROW +static bool isBlacklistedOption(const char *keyword) noexcept { // We already let the user set these options elsewhere const char *cupsOptionBlacklist[] = { @@ -734,7 +734,7 @@ void QPrintDialogPrivate::selectPrinter(const QPrinter::OutputFormat outputForma } #if QT_CONFIG(cups) -static std::vector> pageRangesFromString(const QString &pagesString) Q_DECL_NOTHROW +static std::vector> pageRangesFromString(const QString &pagesString) noexcept { std::vector> result; const QStringList items = pagesString.split(','); @@ -788,7 +788,7 @@ static std::vector> pageRangesFromString(const QString &page return result; } -static QString stringFromPageRanges(const std::vector> &pageRanges) Q_DECL_NOTHROW +static QString stringFromPageRanges(const std::vector> &pageRanges) noexcept { QString result; @@ -805,7 +805,7 @@ static QString stringFromPageRanges(const std::vector> &page return result; } -static bool isValidPagesString(const QString &pagesString) Q_DECL_NOTHROW +static bool isValidPagesString(const QString &pagesString) noexcept { if (pagesString.isEmpty()) return false; diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp index 8505e8356c..5236b8c8fa 100644 --- a/src/printsupport/kernel/qcups.cpp +++ b/src/printsupport/kernel/qcups.cpp @@ -44,12 +44,12 @@ QT_BEGIN_NAMESPACE -static QStringList cupsOptionsList(QPrinter *printer) Q_DECL_NOTHROW +static QStringList cupsOptionsList(QPrinter *printer) noexcept { return printer->printEngine()->property(PPK_CupsOptions).toStringList(); } -void setCupsOptions(QPrinter *printer, const QStringList &cupsOptions) Q_DECL_NOTHROW +void setCupsOptions(QPrinter *printer, const QStringList &cupsOptions) noexcept { printer->printEngine()->setProperty(PPK_CupsOptions, QVariant(cupsOptions)); } diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h index 6dac47a7fe..7dfb6eb9ec 100644 --- a/src/sql/kernel/qsqlerror.h +++ b/src/sql/kernel/qsqlerror.h @@ -66,15 +66,15 @@ public: ErrorType type = NoError, const QString &errorCode = QString()); QSqlError(const QSqlError& other); - QSqlError(QSqlError &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; } + QSqlError(QSqlError &&other) noexcept : d(other.d) { other.d = nullptr; } QSqlError& operator=(const QSqlError& other); - QSqlError &operator=(QSqlError &&other) Q_DECL_NOTHROW { swap(other); return *this; } + QSqlError &operator=(QSqlError &&other) noexcept { swap(other); return *this; } bool operator==(const QSqlError& other) const; bool operator!=(const QSqlError& other) const; ~QSqlError(); - void swap(QSqlError &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + void swap(QSqlError &other) noexcept { qSwap(d, other.d); } QString driverText() const; QString databaseText() const; diff --git a/src/sql/models/qsqlrelationaltablemodel.h b/src/sql/models/qsqlrelationaltablemodel.h index 555755009c..1929bd320a 100644 --- a/src/sql/models/qsqlrelationaltablemodel.h +++ b/src/sql/models/qsqlrelationaltablemodel.h @@ -58,7 +58,7 @@ public: const QString &displayCol) : tName(aTableName), iColumn(indexCol), dColumn(displayCol) {} - void swap(QSqlRelation &other) Q_DECL_NOTHROW + void swap(QSqlRelation &other) noexcept { qSwap(tName, other.tName); qSwap(iColumn, other.iColumn); @@ -71,7 +71,7 @@ public: { return iColumn; } inline QString displayColumn() const { return dColumn; } - bool isValid() const Q_DECL_NOTHROW + bool isValid() const noexcept { return !(tName.isEmpty() || iColumn.isEmpty() || dColumn.isEmpty()); } private: QString tName, iColumn, dColumn; diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h index 77f9fae09a..74f775a0bd 100644 --- a/src/widgets/dialogs/qdialog_p.h +++ b/src/widgets/dialogs/qdialog_p.h @@ -140,14 +140,14 @@ class QAutoPointer { struct internal { void func() {} }; typedef void (internal::*RestrictedBool)(); public: - explicit QAutoPointer(T *t) Q_DECL_NOTHROW : o(t) {} + explicit QAutoPointer(T *t) noexcept : o(t) {} ~QAutoPointer() { delete o; } - T *operator->() const Q_DECL_NOTHROW { return get(); } - T *get() const Q_DECL_NOTHROW { return o; } + T *operator->() const noexcept { return get(); } + T *get() const noexcept { return o; } T &operator*() const { return *get(); } - operator RestrictedBool() const Q_DECL_NOTHROW { return o ? &internal::func : nullptr; } - bool operator!() const Q_DECL_NOTHROW { return !o; } + operator RestrictedBool() const noexcept { return o ? &internal::func : nullptr; } + bool operator!() const noexcept { return !o; } private: Q_DISABLE_COPY(QAutoPointer); }; diff --git a/src/widgets/kernel/qsizepolicy.cpp b/src/widgets/kernel/qsizepolicy.cpp index b5a0cd3940..54bf8fe0dc 100644 --- a/src/widgets/kernel/qsizepolicy.cpp +++ b/src/widgets/kernel/qsizepolicy.cpp @@ -232,7 +232,7 @@ QT_BEGIN_NAMESPACE Returns the control type associated with the widget for which this size policy applies. */ -QSizePolicy::ControlType QSizePolicy::controlType() const Q_DECL_NOTHROW +QSizePolicy::ControlType QSizePolicy::controlType() const noexcept { return QSizePolicy::ControlType(1 << bits.ctype); } @@ -253,7 +253,7 @@ QSizePolicy::ControlType QSizePolicy::controlType() const Q_DECL_NOTHROW \sa QStyle::layoutSpacing() */ -void QSizePolicy::setControlType(ControlType type) Q_DECL_NOTHROW +void QSizePolicy::setControlType(ControlType type) noexcept { bits.ctype = toControlTypeFieldValue(type); } diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h index dba742dec5..f26923eeb0 100644 --- a/src/widgets/kernel/qsizepolicy.h +++ b/src/widgets/kernel/qsizepolicy.h @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE class QVariant; class QSizePolicy; -Q_DECL_CONST_FUNCTION inline uint qHash(QSizePolicy key, uint seed = 0) Q_DECL_NOTHROW; +Q_DECL_CONST_FUNCTION inline uint qHash(QSizePolicy key, uint seed = 0) noexcept; class Q_WIDGETS_EXPORT QSizePolicy { @@ -110,60 +110,60 @@ public: Q_DECLARE_FLAGS(ControlTypes, ControlType) Q_FLAG(ControlTypes) - QT_SIZEPOLICY_CONSTEXPR QSizePolicy() Q_DECL_NOTHROW : data(0) { } + QT_SIZEPOLICY_CONSTEXPR QSizePolicy() noexcept : data(0) { } #if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_QDOC) - QT_SIZEPOLICY_CONSTEXPR QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) Q_DECL_NOTHROW + QT_SIZEPOLICY_CONSTEXPR QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) noexcept : bits{0, 0, quint32(horizontal), quint32(vertical), type == DefaultType ? 0 : toControlTypeFieldValue(type), 0, 0, 0} {} #else - QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) Q_DECL_NOTHROW + QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) noexcept : data(0) { bits.horPolicy = horizontal; bits.verPolicy = vertical; setControlType(type); } #endif // uniform-init - QT_SIZEPOLICY_CONSTEXPR Policy horizontalPolicy() const Q_DECL_NOTHROW { return static_cast(bits.horPolicy); } - QT_SIZEPOLICY_CONSTEXPR Policy verticalPolicy() const Q_DECL_NOTHROW { return static_cast(bits.verPolicy); } - ControlType controlType() const Q_DECL_NOTHROW; + QT_SIZEPOLICY_CONSTEXPR Policy horizontalPolicy() const noexcept { return static_cast(bits.horPolicy); } + QT_SIZEPOLICY_CONSTEXPR Policy verticalPolicy() const noexcept { return static_cast(bits.verPolicy); } + ControlType controlType() const noexcept; - Q_DECL_RELAXED_CONSTEXPR void setHorizontalPolicy(Policy d) Q_DECL_NOTHROW { bits.horPolicy = d; } - Q_DECL_RELAXED_CONSTEXPR void setVerticalPolicy(Policy d) Q_DECL_NOTHROW { bits.verPolicy = d; } - void setControlType(ControlType type) Q_DECL_NOTHROW; + Q_DECL_RELAXED_CONSTEXPR void setHorizontalPolicy(Policy d) noexcept { bits.horPolicy = d; } + Q_DECL_RELAXED_CONSTEXPR void setVerticalPolicy(Policy d) noexcept { bits.verPolicy = d; } + void setControlType(ControlType type) noexcept; - QT_SIZEPOLICY_CONSTEXPR Qt::Orientations expandingDirections() const Q_DECL_NOTHROW { + QT_SIZEPOLICY_CONSTEXPR Qt::Orientations expandingDirections() const noexcept { return ( (verticalPolicy() & ExpandFlag) ? Qt::Vertical : Qt::Orientations() ) | ( (horizontalPolicy() & ExpandFlag) ? Qt::Horizontal : Qt::Orientations() ) ; } - Q_DECL_RELAXED_CONSTEXPR void setHeightForWidth(bool b) Q_DECL_NOTHROW { bits.hfw = b; } - QT_SIZEPOLICY_CONSTEXPR bool hasHeightForWidth() const Q_DECL_NOTHROW { return bits.hfw; } - Q_DECL_RELAXED_CONSTEXPR void setWidthForHeight(bool b) Q_DECL_NOTHROW { bits.wfh = b; } - QT_SIZEPOLICY_CONSTEXPR bool hasWidthForHeight() const Q_DECL_NOTHROW { return bits.wfh; } + Q_DECL_RELAXED_CONSTEXPR void setHeightForWidth(bool b) noexcept { bits.hfw = b; } + QT_SIZEPOLICY_CONSTEXPR bool hasHeightForWidth() const noexcept { return bits.hfw; } + Q_DECL_RELAXED_CONSTEXPR void setWidthForHeight(bool b) noexcept { bits.wfh = b; } + QT_SIZEPOLICY_CONSTEXPR bool hasWidthForHeight() const noexcept { return bits.wfh; } - QT_SIZEPOLICY_CONSTEXPR bool operator==(const QSizePolicy& s) const Q_DECL_NOTHROW { return data == s.data; } - QT_SIZEPOLICY_CONSTEXPR bool operator!=(const QSizePolicy& s) const Q_DECL_NOTHROW { return data != s.data; } + QT_SIZEPOLICY_CONSTEXPR bool operator==(const QSizePolicy& s) const noexcept { return data == s.data; } + QT_SIZEPOLICY_CONSTEXPR bool operator!=(const QSizePolicy& s) const noexcept { return data != s.data; } - friend Q_DECL_CONST_FUNCTION uint qHash(QSizePolicy key, uint seed) Q_DECL_NOTHROW { return qHash(key.data, seed); } + friend Q_DECL_CONST_FUNCTION uint qHash(QSizePolicy key, uint seed) noexcept { return qHash(key.data, seed); } operator QVariant() const; - QT_SIZEPOLICY_CONSTEXPR int horizontalStretch() const Q_DECL_NOTHROW { return static_cast(bits.horStretch); } - QT_SIZEPOLICY_CONSTEXPR int verticalStretch() const Q_DECL_NOTHROW { return static_cast(bits.verStretch); } + QT_SIZEPOLICY_CONSTEXPR int horizontalStretch() const noexcept { return static_cast(bits.horStretch); } + QT_SIZEPOLICY_CONSTEXPR int verticalStretch() const noexcept { return static_cast(bits.verStretch); } Q_DECL_RELAXED_CONSTEXPR void setHorizontalStretch(int stretchFactor) { bits.horStretch = static_cast(qBound(0, stretchFactor, 255)); } Q_DECL_RELAXED_CONSTEXPR void setVerticalStretch(int stretchFactor) { bits.verStretch = static_cast(qBound(0, stretchFactor, 255)); } - QT_SIZEPOLICY_CONSTEXPR bool retainSizeWhenHidden() const Q_DECL_NOTHROW { return bits.retainSizeWhenHidden; } - Q_DECL_RELAXED_CONSTEXPR void setRetainSizeWhenHidden(bool retainSize) Q_DECL_NOTHROW { bits.retainSizeWhenHidden = retainSize; } + QT_SIZEPOLICY_CONSTEXPR bool retainSizeWhenHidden() const noexcept { return bits.retainSizeWhenHidden; } + Q_DECL_RELAXED_CONSTEXPR void setRetainSizeWhenHidden(bool retainSize) noexcept { bits.retainSizeWhenHidden = retainSize; } - Q_DECL_RELAXED_CONSTEXPR void transpose() Q_DECL_NOTHROW { *this = transposed(); } + Q_DECL_RELAXED_CONSTEXPR void transpose() noexcept { *this = transposed(); } Q_REQUIRED_RESULT #ifndef Q_QDOC QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT #endif - QSizePolicy transposed() const Q_DECL_NOTHROW + QSizePolicy transposed() const noexcept { return QSizePolicy(bits.transposed()); } @@ -173,11 +173,11 @@ private: friend Q_WIDGETS_EXPORT QDataStream &operator<<(QDataStream &, const QSizePolicy &); friend Q_WIDGETS_EXPORT QDataStream &operator>>(QDataStream &, QSizePolicy &); #endif - QT_SIZEPOLICY_CONSTEXPR QSizePolicy(int i) Q_DECL_NOTHROW : data(i) { } + QT_SIZEPOLICY_CONSTEXPR QSizePolicy(int i) noexcept : data(i) { } struct Bits; - QT_SIZEPOLICY_CONSTEXPR explicit QSizePolicy(Bits b) Q_DECL_NOTHROW : bits(b) { } + QT_SIZEPOLICY_CONSTEXPR explicit QSizePolicy(Bits b) noexcept : bits(b) { } - static Q_DECL_RELAXED_CONSTEXPR quint32 toControlTypeFieldValue(ControlType type) Q_DECL_NOTHROW + static Q_DECL_RELAXED_CONSTEXPR quint32 toControlTypeFieldValue(ControlType type) noexcept { /* The control type is a flag type, with values 0x1, 0x2, 0x4, 0x8, 0x10, @@ -207,7 +207,7 @@ private: quint32 retainSizeWhenHidden : 1; QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT - Bits transposed() const Q_DECL_NOTHROW + Bits transposed() const noexcept { return {verStretch, // \ swap horStretch, // / diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 47c5267c73..510b34cb18 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -827,9 +827,9 @@ class StaticDayOfWeekAssociativeArray { bool contained[7]; T data[7]; - static Q_DECL_CONSTEXPR int day2idx(Qt::DayOfWeek day) Q_DECL_NOTHROW { return int(day) - 1; } // alt: day % 7 + static Q_DECL_CONSTEXPR int day2idx(Qt::DayOfWeek day) noexcept { return int(day) - 1; } // alt: day % 7 public: - Q_DECL_CONSTEXPR StaticDayOfWeekAssociativeArray() Q_DECL_NOEXCEPT_EXPR(noexcept(T())) + Q_DECL_CONSTEXPR StaticDayOfWeekAssociativeArray() noexcept(noexcept(T())) #ifdef Q_COMPILER_CONSTEXPR : contained{}, data{} // arrays require uniform initialization #else @@ -837,17 +837,17 @@ public: #endif {} - Q_DECL_CONSTEXPR bool contains(Qt::DayOfWeek day) const Q_DECL_NOTHROW { return contained[day2idx(day)]; } - Q_DECL_CONSTEXPR const T &value(Qt::DayOfWeek day) const Q_DECL_NOTHROW { return data[day2idx(day)]; } + Q_DECL_CONSTEXPR bool contains(Qt::DayOfWeek day) const noexcept { return contained[day2idx(day)]; } + Q_DECL_CONSTEXPR const T &value(Qt::DayOfWeek day) const noexcept { return data[day2idx(day)]; } - Q_DECL_RELAXED_CONSTEXPR T &operator[](Qt::DayOfWeek day) Q_DECL_NOTHROW + Q_DECL_RELAXED_CONSTEXPR T &operator[](Qt::DayOfWeek day) noexcept { const int idx = day2idx(day); contained[idx] = true; return data[idx]; } - Q_DECL_RELAXED_CONSTEXPR void insert(Qt::DayOfWeek day, T v) Q_DECL_NOTHROW + Q_DECL_RELAXED_CONSTEXPR void insert(Qt::DayOfWeek day, T v) noexcept { operator[](day).swap(v); } diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h index 94dc8dfb8e..26b674c894 100644 --- a/src/xml/sax/qxml.h +++ b/src/xml/sax/qxml.h @@ -118,14 +118,14 @@ public: QXmlAttributes(); #ifdef Q_COMPILER_DEFAULT_MEMBERS QXmlAttributes(const QXmlAttributes &) = default; - QXmlAttributes(QXmlAttributes &&) Q_DECL_NOTHROW = default; + QXmlAttributes(QXmlAttributes &&) noexcept = default; QXmlAttributes &operator=(const QXmlAttributes &) = default; - QXmlAttributes &operator=(QXmlAttributes &&) Q_DECL_NOTHROW = default; + QXmlAttributes &operator=(QXmlAttributes &&) noexcept = default; #endif // default members QT6_NOT_VIRTUAL ~QXmlAttributes(); - void swap(QXmlAttributes &other) Q_DECL_NOTHROW + void swap(QXmlAttributes &other) noexcept { qSwap(attList, other.attList); qSwap(d, other.d); -- cgit v1.2.3