From dd84eab9d8cccedeaaa4b00eea05e498a1aaeae7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 7 Feb 2012 19:05:27 +0100 Subject: [PATCH] fix msvc 2008 warning about downcasting to bool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the compiler doesn't have static_assert yet, so we ran into the path which was not fixed by 10229ae. use !!() pattern instead of bool() cast, as the latter throws off macx (see 95d7abb). the other alternative - a c-style cast - would cause autotest failures (see 92464fa), and would be ugly anyway. Change-Id: Idbe9a3b60e17ae1f566f938d9b9be04f0c977492 Reviewed-by: João Abecasis --- src/corelib/global/qglobal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index f0d902f1f5..33b5b8bd76 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1031,7 +1031,7 @@ template <> class QStaticAssertFailure {}; #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(Condition) \ - enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<(Condition)>)} + enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure)} #define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition) #endif