From 3e1d03b1eaf6a5e842bed4ae4f9bb8cca05e5b31 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 11 Jun 2020 11:35:19 +0200 Subject: Port Q_STATIC_ASSERT(_X) to static_assert There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll --- src/corelib/kernel/qdeadlinetimer.cpp | 4 ++-- src/corelib/kernel/qelapsedtimer_mac.cpp | 2 +- src/corelib/kernel/qelapsedtimer_unix.cpp | 2 +- src/corelib/kernel/qelapsedtimer_win.cpp | 2 +- src/corelib/kernel/qmetaobject.h | 4 ++-- src/corelib/kernel/qmetaobjectbuilder.cpp | 2 +- src/corelib/kernel/qmetatype.cpp | 8 ++++---- src/corelib/kernel/qmetatype.h | 14 +++++++------- src/corelib/kernel/qmetatype_p.h | 2 +- src/corelib/kernel/qobject.h | 30 +++++++++++++++--------------- src/corelib/kernel/qobject_p.h | 12 ++++++------ src/corelib/kernel/qobjectdefs_impl.h | 4 ++-- src/corelib/kernel/qpointer.h | 2 +- src/corelib/kernel/qtimer.h | 4 ++-- src/corelib/kernel/qvariant.cpp | 2 +- src/corelib/kernel/qvariant_p.h | 22 +++++++++++----------- 16 files changed, 58 insertions(+), 58 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp index 520153b2e5..0ca052764a 100644 --- a/src/corelib/kernel/qdeadlinetimer.cpp +++ b/src/corelib/kernel/qdeadlinetimer.cpp @@ -190,7 +190,7 @@ bool TimeReference::addSecsAndNSecs(qint64 addSecs, qint64 addNSecs) */ bool TimeReference::adjust(const qint64 t1, const unsigned t2, qint64 carrySeconds) { - Q_STATIC_ASSERT(QDeadlineTimerNanosecondsInT2); + static_assert(QDeadlineTimerNanosecondsInT2); nsecs += t2; if (nsecs >= ugiga) { nsecs -= ugiga; @@ -291,7 +291,7 @@ inline bool TimeReference::addSecsAndNSecs(qint64 addSecs, qint64 addNSecs) inline bool TimeReference::adjust(const qint64 t1, const unsigned t2, qint64 carrySeconds) { - Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2); + static_assert(!QDeadlineTimerNanosecondsInT2); Q_UNUSED(t2); Q_UNUSED(carrySeconds); diff --git a/src/corelib/kernel/qelapsedtimer_mac.cpp b/src/corelib/kernel/qelapsedtimer_mac.cpp index 5370cf7b3d..1d9f02dff0 100644 --- a/src/corelib/kernel/qelapsedtimer_mac.cpp +++ b/src/corelib/kernel/qelapsedtimer_mac.cpp @@ -156,7 +156,7 @@ bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept { - Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2); + static_assert(!QDeadlineTimerNanosecondsInT2); QDeadlineTimer result; result.type = timerType; result.t1 = absoluteToNSecs(mach_absolute_time()); diff --git a/src/corelib/kernel/qelapsedtimer_unix.cpp b/src/corelib/kernel/qelapsedtimer_unix.cpp index ccc2eeafa3..59f5f90155 100644 --- a/src/corelib/kernel/qelapsedtimer_unix.cpp +++ b/src/corelib/kernel/qelapsedtimer_unix.cpp @@ -252,7 +252,7 @@ bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept { - Q_STATIC_ASSERT(QDeadlineTimerNanosecondsInT2); + static_assert(QDeadlineTimerNanosecondsInT2); QDeadlineTimer result; qint64 cursec, curnsec; do_gettime(&cursec, &curnsec); diff --git a/src/corelib/kernel/qelapsedtimer_win.cpp b/src/corelib/kernel/qelapsedtimer_win.cpp index 8becb17461..deeeb05921 100644 --- a/src/corelib/kernel/qelapsedtimer_win.cpp +++ b/src/corelib/kernel/qelapsedtimer_win.cpp @@ -162,7 +162,7 @@ bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept { - Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2); + static_assert(!QDeadlineTimerNanosecondsInT2); QDeadlineTimer result; result.t1 = ticksToNanoseconds(getTickCount()); result.type = timerType; diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h index 474e4da0f1..20a5c67586 100644 --- a/src/corelib/kernel/qmetaobject.h +++ b/src/corelib/kernel/qmetaobject.h @@ -171,7 +171,7 @@ public: static inline QMetaMethod fromSignal(PointerToMemberFunction signal) { typedef QtPrivate::FunctionPointer SignalType; - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "No Q_OBJECT in the class with the signal"); return fromSignalImpl(&SignalType::Object::staticMetaObject, reinterpret_cast(&signal)); @@ -241,7 +241,7 @@ public: inline bool isValid() const { return name() != nullptr; } template static QMetaEnum fromType() { - Q_STATIC_ASSERT_X(QtPrivate::IsQEnumHelper::Value, + static_assert(QtPrivate::IsQEnumHelper::Value, "QMetaEnum::fromType only works with enums declared as " "Q_ENUM, Q_ENUM_NS, Q_FLAG or Q_FLAG_NS"); const QMetaObject *metaObject = qt_getEnumMetaObject(T()); diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp index 204ba8f51b..1902b5e360 100644 --- a/src/corelib/kernel/qmetaobjectbuilder.cpp +++ b/src/corelib/kernel/qmetaobjectbuilder.cpp @@ -1193,7 +1193,7 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf, - int(d->methods.size()) // return "parameters" don't have names - int(d->constructors.size()); // "this" parameters don't have names if (buf) { - Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 9, "QMetaObjectBuilder should generate the same version as moc"); + static_assert(QMetaObjectPrivate::OutputRevision == 9, "QMetaObjectBuilder should generate the same version as moc"); pmeta->revision = QMetaObjectPrivate::OutputRevision; pmeta->flags = d->flags; pmeta->className = 0; // Class name is always the first string. diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 10fc5701e5..61515f7ea5 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1293,7 +1293,7 @@ class HasStreamOperator { struct Yes { char unused[1]; }; struct No { char unused[2]; }; - Q_STATIC_ASSERT(sizeof(Yes) != sizeof(No)); + static_assert(sizeof(Yes) != sizeof(No)); template static decltype(std::declval().operator>>(std::declval()), Yes()) load(int); template static decltype(operator>>(std::declval(), std::declval()), Yes()) load(int); @@ -1310,9 +1310,9 @@ public: }; // Quick sanity checks -Q_STATIC_ASSERT(HasStreamOperator::Value); -Q_STATIC_ASSERT(!HasStreamOperator::Value); -Q_STATIC_ASSERT(HasStreamOperator::Value); +static_assert(HasStreamOperator::Value); +static_assert(!HasStreamOperator::Value); +static_assert(HasStreamOperator::Value); template::IsAccepted && HasStreamOperator::Value> struct FilteredOperatorSwitch diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index f59acf2d54..196df677e9 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -580,7 +580,7 @@ public: template static bool registerComparators() { - Q_STATIC_ASSERT_X((!QMetaTypeId2::IsBuiltIn), + static_assert((!QMetaTypeId2::IsBuiltIn), "QMetaType::registerComparators: The type must be a custom type."); const int typeId = qMetaTypeId(); @@ -590,7 +590,7 @@ public: template static bool registerEqualsComparator() { - Q_STATIC_ASSERT_X((!QMetaTypeId2::IsBuiltIn), + static_assert((!QMetaTypeId2::IsBuiltIn), "QMetaType::registerEqualsComparator: The type must be a custom type."); const int typeId = qMetaTypeId(); static const QtPrivate::BuiltInEqualsComparatorFunction f; @@ -609,7 +609,7 @@ public: template static bool registerDebugStreamOperator() { - Q_STATIC_ASSERT_X((!QMetaTypeId2::IsBuiltIn), + static_assert((!QMetaTypeId2::IsBuiltIn), "QMetaType::registerDebugStreamOperator: The type must be a custom type."); const int typeId = qMetaTypeId(); @@ -643,7 +643,7 @@ public: template static bool registerConverter(To(From::*function)() const) { - Q_STATIC_ASSERT_X((!QMetaTypeId2::IsBuiltIn || !QMetaTypeId2::IsBuiltIn), + static_assert((!QMetaTypeId2::IsBuiltIn || !QMetaTypeId2::IsBuiltIn), "QMetaType::registerConverter: At least one of the types must be a custom type."); const int fromTypeId = qMetaTypeId(); @@ -656,7 +656,7 @@ public: template static bool registerConverter(To(From::*function)(bool*) const) { - Q_STATIC_ASSERT_X((!QMetaTypeId2::IsBuiltIn || !QMetaTypeId2::IsBuiltIn), + static_assert((!QMetaTypeId2::IsBuiltIn || !QMetaTypeId2::IsBuiltIn), "QMetaType::registerConverter: At least one of the types must be a custom type."); const int fromTypeId = qMetaTypeId(); @@ -669,7 +669,7 @@ public: template static bool registerConverter(UnaryFunction function) { - Q_STATIC_ASSERT_X((!QMetaTypeId2::IsBuiltIn || !QMetaTypeId2::IsBuiltIn), + static_assert((!QMetaTypeId2::IsBuiltIn || !QMetaTypeId2::IsBuiltIn), "QMetaType::registerConverter: At least one of the types must be a custom type."); const int fromTypeId = qMetaTypeId(); @@ -1444,7 +1444,7 @@ namespace QtPrivate static yes_type checkType(QObject* ); #endif static no_type checkType(...); - Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined"); + static_assert(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined"); enum { Value = sizeof(checkType(static_cast(nullptr))) == sizeof(yes_type) }; }; diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h index 2f4d69488f..d8dba13770 100644 --- a/src/corelib/kernel/qmetatype_p.h +++ b/src/corelib/kernel/qmetatype_p.h @@ -94,7 +94,7 @@ public: \ IsUnknown = !(IsCore || IsWidget || IsGui) \ }; \ static inline int module() { return MODULE; } \ - Q_STATIC_ASSERT((IsUnknown && !(IsCore || IsWidget || IsGui)) \ + static_assert((IsUnknown && !(IsCore || IsWidget || IsGui)) \ || (IsCore && !(IsUnknown || IsWidget || IsGui)) \ || (IsWidget && !(IsUnknown || IsCore || IsGui)) \ || (IsGui && !(IsUnknown || IsCore || IsWidget))); \ diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 556d975786..ea635ce6f1 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -220,15 +220,15 @@ public: typedef QtPrivate::FunctionPointer SignalType; typedef QtPrivate::FunctionPointer SlotType; - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "No Q_OBJECT in the class with the signal"); //compilation error if the arguments does not match. - Q_STATIC_ASSERT_X(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount), + static_assert(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount), "The slot requires more arguments than the signal provides."); - Q_STATIC_ASSERT_X((QtPrivate::CheckCompatibleArguments::value), + static_assert((QtPrivate::CheckCompatibleArguments::value), "Signal and slot arguments are not compatible."); - Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible::value), + static_assert((QtPrivate::AreArgumentsCompatible::value), "Return type of the slot is not compatible with the return type of the signal."); const int *types = nullptr; @@ -260,15 +260,15 @@ public: typedef QtPrivate::FunctionPointer SignalType; typedef QtPrivate::FunctionPointer SlotType; - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "No Q_OBJECT in the class with the signal"); //compilation error if the arguments does not match. - Q_STATIC_ASSERT_X(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount), + static_assert(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount), "The slot requires more arguments than the signal provides."); - Q_STATIC_ASSERT_X((QtPrivate::CheckCompatibleArguments::value), + static_assert((QtPrivate::CheckCompatibleArguments::value), "Signal and slot arguments are not compatible."); - Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible::value), + static_assert((QtPrivate::AreArgumentsCompatible::value), "Return type of the slot is not compatible with the return type of the signal."); const int *types = nullptr; @@ -299,15 +299,15 @@ public: typedef QtPrivate::FunctionPointer SignalType; const int FunctorArgumentCount = QtPrivate::ComputeFunctorArgumentCount::Value; - Q_STATIC_ASSERT_X((FunctorArgumentCount >= 0), + static_assert((FunctorArgumentCount >= 0), "Signal and slot arguments are not compatible."); const int SlotArgumentCount = (FunctorArgumentCount >= 0) ? FunctorArgumentCount : 0; typedef typename QtPrivate::FunctorReturnType::Value>::Value SlotReturnType; - Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible::value), + static_assert((QtPrivate::AreArgumentsCompatible::value), "Return type of the slot is not compatible with the return type of the signal."); - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "No Q_OBJECT in the class with the signal"); const int *types = nullptr; @@ -344,11 +344,11 @@ public: typedef QtPrivate::FunctionPointer SignalType; typedef QtPrivate::FunctionPointer SlotType; - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "No Q_OBJECT in the class with the signal"); //compilation error if the arguments does not match. - Q_STATIC_ASSERT_X((QtPrivate::CheckCompatibleArguments::value), + static_assert((QtPrivate::CheckCompatibleArguments::value), "Signal and slot arguments are not compatible."); return disconnectImpl(sender, reinterpret_cast(&signal), receiver, reinterpret_cast(&slot), @@ -461,7 +461,7 @@ template inline T qobject_cast(QObject *object) { typedef typename std::remove_cv::type>::type ObjType; - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "qobject_cast requires the type to have a Q_OBJECT macro"); return static_cast(ObjType::staticMetaObject.cast(object)); } @@ -470,7 +470,7 @@ template inline T qobject_cast(const QObject *object) { typedef typename std::remove_cv::type>::type ObjType; - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "qobject_cast requires the type to have a Q_OBJECT macro"); return static_cast(ObjType::staticMetaObject.cast(object)); } diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 97b492360c..ae6e4d3452 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -457,15 +457,15 @@ inline QMetaObject::Connection QObjectPrivate::connect(const typename QtPrivate: { typedef QtPrivate::FunctionPointer SignalType; typedef QtPrivate::FunctionPointer SlotType; - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "No Q_OBJECT in the class with the signal"); //compilation error if the arguments does not match. - Q_STATIC_ASSERT_X(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount), + static_assert(int(SignalType::ArgumentCount) >= int(SlotType::ArgumentCount), "The slot requires more arguments than the signal provides."); - Q_STATIC_ASSERT_X((QtPrivate::CheckCompatibleArguments::value), + static_assert((QtPrivate::CheckCompatibleArguments::value), "Signal and slot arguments are not compatible."); - Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible::value), + static_assert((QtPrivate::AreArgumentsCompatible::value), "Return type of the slot is not compatible with the return type of the signal."); const int *types = nullptr; @@ -485,10 +485,10 @@ bool QObjectPrivate::disconnect(const typename QtPrivate::FunctionPointer< Func1 { typedef QtPrivate::FunctionPointer SignalType; typedef QtPrivate::FunctionPointer SlotType; - Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro::Value, + static_assert(QtPrivate::HasQ_OBJECT_Macro::Value, "No Q_OBJECT in the class with the signal"); //compilation error if the arguments does not match. - Q_STATIC_ASSERT_X((QtPrivate::CheckCompatibleArguments::value), + static_assert((QtPrivate::CheckCompatibleArguments::value), "Signal and slot arguments are not compatible."); return QObject::disconnectImpl(sender, reinterpret_cast(&signal), receiverPrivate->q_ptr, reinterpret_cast(&slot), diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index 71d6e236d7..f3f7f3df72 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -287,7 +287,7 @@ namespace QtPrivate { /* Logic that check if the arguments of the slot matches the argument of the signal. To be used like this: - Q_STATIC_ASSERT(CheckCompatibleArguments::Arguments, FunctionPointer::Arguments>::value) + static_assert(CheckCompatibleArguments::Arguments, FunctionPointer::Arguments>::value) */ template struct AreArgumentsCompatible { static int test(const typename RemoveRef::Type&); @@ -296,7 +296,7 @@ namespace QtPrivate { enum { value = sizeof(test(dummy())) == sizeof(int) }; #ifdef QT_NO_NARROWING_CONVERSIONS_IN_CONNECT using AreArgumentsConvertibleWithoutNarrowing = AreArgumentsConvertibleWithoutNarrowingBase, std::decay_t>; - Q_STATIC_ASSERT_X(AreArgumentsConvertibleWithoutNarrowing::value, "Signal and slot arguments are not compatible (narrowing)"); + static_assert(AreArgumentsConvertibleWithoutNarrowing::value, "Signal and slot arguments are not compatible (narrowing)"); #endif }; template struct AreArgumentsCompatible { enum { value = false }; }; diff --git a/src/corelib/kernel/qpointer.h b/src/corelib/kernel/qpointer.h index 769ace5a71..ebc06a0fb1 100644 --- a/src/corelib/kernel/qpointer.h +++ b/src/corelib/kernel/qpointer.h @@ -52,7 +52,7 @@ class QVariant; template class QPointer { - Q_STATIC_ASSERT_X(!std::is_pointer::value, "QPointer's template type must not be a pointer type"); + static_assert(!std::is_pointer::value, "QPointer's template type must not be a pointer type"); using QObjectType = typename std::conditional::value, const QObject, QObject>::type; diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index 6bbfd741d9..c55fd8d6c3 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -116,7 +116,7 @@ public: typedef QtPrivate::FunctionPointer SlotType; //compilation error if the slot has arguments. - Q_STATIC_ASSERT_X(int(SlotType::ArgumentCount) == 0, + static_assert(int(SlotType::ArgumentCount) == 0, "The slot must not have any arguments."); singleShotImpl(interval, timerType, receiver, @@ -152,7 +152,7 @@ public: { //compilation error if the slot has arguments. typedef QtPrivate::FunctionPointer SlotType; - Q_STATIC_ASSERT_X(int(SlotType::ArgumentCount) <= 0, "The slot must not have any arguments."); + static_assert(int(SlotType::ArgumentCount) <= 0, "The slot must not have any arguments."); singleShotImpl(interval, timerType, context, new QtPrivate::QFunctorSlotObject::isRelocatable) || std::is_enum::value); typedef std::integral_constant CanUseInternalSpace_t; }; -Q_STATIC_ASSERT(QVariantIntegrator::CanUseInternalSpace); -Q_STATIC_ASSERT(QVariantIntegrator::CanUseInternalSpace); -Q_STATIC_ASSERT(QVariantIntegrator::CanUseInternalSpace); +static_assert(QVariantIntegrator::CanUseInternalSpace); +static_assert(QVariantIntegrator::CanUseInternalSpace); +static_assert(QVariantIntegrator::CanUseInternalSpace); #ifdef Q_CC_SUN // Sun CC picks the wrong overload, so introduce awful hack @@ -267,7 +267,7 @@ class QVariantIsNull class HasIsNullMethod { struct Yes { char unused[1]; }; struct No { char unused[2]; }; - Q_STATIC_ASSERT(sizeof(Yes) != sizeof(No)); + static_assert(sizeof(Yes) != sizeof(No)); template static decltype(static_cast(nullptr)->isNull(), Yes()) test(int); template static No test(...); @@ -276,19 +276,19 @@ class QVariantIsNull }; // TODO This part should go to autotests during HasIsNullMethod generalization. - Q_STATIC_ASSERT(!HasIsNullMethod::Value); + static_assert(!HasIsNullMethod::Value); struct SelfTest1 { bool isNull() const; }; - Q_STATIC_ASSERT(HasIsNullMethod::Value); + static_assert(HasIsNullMethod::Value); struct SelfTest2 {}; - Q_STATIC_ASSERT(!HasIsNullMethod::Value); + static_assert(!HasIsNullMethod::Value); struct SelfTest3 : public SelfTest1 {}; - Q_STATIC_ASSERT(HasIsNullMethod::Value); + static_assert(HasIsNullMethod::Value); struct SelfTestFinal1 final { bool isNull() const; }; - Q_STATIC_ASSERT(HasIsNullMethod::Value); + static_assert(HasIsNullMethod::Value); struct SelfTestFinal2 final {}; - Q_STATIC_ASSERT(!HasIsNullMethod::Value); + static_assert(!HasIsNullMethod::Value); struct SelfTestFinal3 final : public SelfTest1 {}; - Q_STATIC_ASSERT(HasIsNullMethod::Value); + static_assert(HasIsNullMethod::Value); template::Value> struct CallFilteredIsNull -- cgit v1.2.3