summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/global/qglobal.h4
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index aa52fc17bf..9d3c1be4b1 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1729,8 +1729,8 @@ template <> class QStaticAssertFailure<true> {};
#define Q_STATIC_ASSERT_PRIVATE_JOIN(A, B) Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B)
#define Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B) A ## B
-#define Q_STATIC_ASSERT(...) \
- enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<bool(__VA_ARGS__)>)}
+#define Q_STATIC_ASSERT(Condition) \
+ enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<bool(Condition)>)}
Q_CORE_EXPORT void qt_check_pointer(const char *, int);
Q_CORE_EXPORT void qBadAlloc();
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index 9dc78a14c0..9c6e5ced47 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -319,8 +319,9 @@ struct Template
struct MyTemplate
{
- Q_STATIC_ASSERT(Template<TypeDef, int>::True);
- Q_STATIC_ASSERT(!!Template<TypeDef, int>::True);
+ static const bool Value = Template<TypeDef, int>::True;
+ Q_STATIC_ASSERT(Value);
+ Q_STATIC_ASSERT(!!Value);
};
void tst_QGlobal::qstaticassert()