diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2024-01-25 13:31:45 +0100 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2024-01-26 15:10:22 +0100 |
commit | b9c8c57e3f8f2a07c22059d9c8e7210469198200 (patch) | |
tree | 0bd21399e6a20149c547ca6678d83989217905e5 /tests/manual | |
parent | beebf6450c3720029ba5038b46c6db883504a142 (diff) |
tst_manualqdatastream: fix gcc error
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
Pick-to: 6.7
Change-Id: I7803cce1687ca8ae992f1a57394346eb6fc90c8b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/corelib/qdatastream/tst_manualqdatastream.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tests/manual/corelib/qdatastream/tst_manualqdatastream.cpp b/tests/manual/corelib/qdatastream/tst_manualqdatastream.cpp index ef763189f6..3f63fe5e42 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 <class T> void fill(T &input); - template <> + void fill(QSet<qsizetype> &input); - template <> void fill(QMap<qsizetype, qsizetype> &input); - template <> void fill(QHash<qsizetype, qsizetype> &input); template <class T> @@ -58,7 +56,6 @@ void tst_QDataStream::fill(T &input) qDebug("Created dataset in %lld ms", timer.elapsed()); } -template <> void tst_QDataStream::fill(QSet<qsizetype> &input) { constexpr qsizetype GiB = 1024 * 1024 * 1024; @@ -76,7 +73,6 @@ void tst_QDataStream::fill(QSet<qsizetype> &input) qDebug("Created dataset in %lld ms", timer.elapsed()); } -template <> void tst_QDataStream::fill(QMap<qsizetype, qsizetype> &input) { constexpr qsizetype GiB = 1024 * 1024 * 1024; @@ -93,7 +89,6 @@ void tst_QDataStream::fill(QMap<qsizetype, qsizetype> &input) qDebug("Created dataset in %lld ms", timer.elapsed()); } -template <> void tst_QDataStream::fill(QHash<qsizetype, qsizetype> &input) { constexpr qsizetype GiB = 1024 * 1024 * 1024; |