From 06eac4ebc85e2ddc4f7dbec9b69fc8dfa7d466b4 Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Thu, 25 Jan 2024 13:31:45 +0100 Subject: [PATCH] tst_manualqdatastream: fix gcc error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC has a bug [1] that does not allow to specialize templates outside of a namespace. An attempt to build the test results in the following error: tst_manualqdatastream.cpp:18:15: error: explicit specialization in non-namespace scope ‘class tst_QDataStream’ Fix it by converting the template specializations into simple function overloads. [1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282 Change-Id: I7803cce1687ca8ae992f1a57394346eb6fc90c8b Reviewed-by: Marc Mutz (cherry picked from commit b9c8c57e3f8f2a07c22059d9c8e7210469198200) Reviewed-by: Qt Cherry-pick Bot --- tests/manual/corelib/qdatastream/tst_manualqdatastream.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/manual/corelib/qdatastream/tst_manualqdatastream.cpp b/tests/manual/corelib/qdatastream/tst_manualqdatastream.cpp index 59bff74e132..1bfe29f3c94 100644 --- a/tests/manual/corelib/qdatastream/tst_manualqdatastream.cpp +++ b/tests/manual/corelib/qdatastream/tst_manualqdatastream.cpp @@ -15,11 +15,9 @@ class tst_QDataStream : public QObject template void fill(T &input); - template <> + void fill(QSet &input); - template <> void fill(QMap &input); - template <> void fill(QHash &input); template @@ -58,7 +56,6 @@ void tst_QDataStream::fill(T &input) qDebug("Created dataset in %lld ms", timer.elapsed()); } -template <> void tst_QDataStream::fill(QSet &input) { constexpr qsizetype GiB = 1024 * 1024 * 1024; @@ -76,7 +73,6 @@ void tst_QDataStream::fill(QSet &input) qDebug("Created dataset in %lld ms", timer.elapsed()); } -template <> void tst_QDataStream::fill(QMap &input) { constexpr qsizetype GiB = 1024 * 1024 * 1024; @@ -93,7 +89,6 @@ void tst_QDataStream::fill(QMap &input) qDebug("Created dataset in %lld ms", timer.elapsed()); } -template <> void tst_QDataStream::fill(QHash &input) { constexpr qsizetype GiB = 1024 * 1024 * 1024;