From eb122a6fe4de5b95acb287f92c6ca5e81864b1c6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 16 Nov 2013 14:30:38 +0100 Subject: tst_QAlgorithms: fix compilation with C++11 enabled GCC refuses to use a merely static const uint array in a constexpr function. Fix by making the array constexpr if supported by the compiler. Change-Id: Idd59d3f74f8f4e98aad82bc892f4a6469932df9f Reviewed-by: Olivier Goffart Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp index 144bc62b1b..64eb91b7b6 100644 --- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp @@ -1027,7 +1027,7 @@ void tst_QAlgorithms::binaryFindOnLargeContainer() const } // alternative implementation of qPopulationCount for comparison: -static const uint bitsSetInNibble[] = { +static Q_DECL_CONSTEXPR const uint bitsSetInNibble[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, }; -- cgit v1.2.3