QTest::addColumn: Use nullptr instead of 0

Fixes -Wzero-as-null-pointer-constant warning in user code

Change-Id: I59492633d14947e90e91efa7c4fcd14c33fa413e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Kevin Funk 2016-12-05 13:18:57 +01:00
parent 82a6f38873
commit 6ff4d8c61a

View File

@ -309,7 +309,7 @@ namespace QTest
Q_TESTLIB_EXPORT void addColumnInternal(int id, const char *name); Q_TESTLIB_EXPORT void addColumnInternal(int id, const char *name);
template <typename T> template <typename T>
inline void addColumn(const char *name, T * = 0) inline void addColumn(const char *name, T * = nullptr)
{ {
typedef std::is_same<T, const char*> QIsSameTConstChar; typedef std::is_same<T, const char*> QIsSameTConstChar;
Q_STATIC_ASSERT_X(!QIsSameTConstChar::value, "const char* is not allowed as a test data format."); Q_STATIC_ASSERT_X(!QIsSameTConstChar::value, "const char* is not allowed as a test data format.");