From 1ca1cec64d799db82c5320fa08f9a5340182233e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 2 Dec 2013 19:13:13 -0800 Subject: [PATCH] Make a nicer output when QBasicAtomicInteger is used with a wrong T MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before, we'd get just an error message that the size of the array was negative. Now, for C++11 compilers, we get a better error message: qbasicatomic.h:117:5: error: static assertion failed: Template parameter is not a supported integer on this platform qbasicatomic.h:119:24: error: invalid use of incomplete type ‘struct QAtomicOps’ Change-Id: I6b0792254c0dc6103a4a7608f2942d59cda07c00 Reviewed-by: Olivier Goffart --- src/corelib/thread/qbasicatomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index 782ae90698..3bf6b0c106 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -133,7 +133,7 @@ class QBasicAtomicInteger public: typedef QAtomicOps Ops; // static check that this is a valid integer - typedef char PermittedIntegerType[QAtomicIntegerTraits::IsInteger ? 1 : -1]; + Q_STATIC_ASSERT_X(QAtomicIntegerTraits::IsInteger, "Template parameter is not a supported integer on this platform"); typename Ops::Type _q_value;