summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2015-07-26 14:14:31 +0200
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2015-07-26 19:14:47 +0000
commitf01f1943e49ac3a60c54dd3f3009a445474dc412 (patch)
tree1d02f0c7a450fdd0e46075a8771be973c5d10e63 /tests
parent150aa19042bbee893c5b4f16cb230f9266a1f4b7 (diff)
Fix compilation error while instantiating operator<< explicitly
Task-number: QTBUG-47375 Change-Id: Ibd260de88c174c1aa3833a56b153b8b74d337338 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index 32344f1e26..4e5cfed019 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -625,5 +625,14 @@ void tst_QDebug::threadSafety() const
}
}
+// Should compile: instentiation of unrelated operator<< should not cause cause compilation
+// error in QDebug operators (QTBUG-47375)
+class TestClassA {};
+class TestClassB {};
+
+template <typename T>
+TestClassA& operator<< (TestClassA& s, T&) { return s; };
+template<> TestClassA& operator<< <TestClassB>(TestClassA& s, TestClassB& l);
+
QTEST_MAIN(tst_QDebug);
#include "tst_qdebug.moc"