From 920dcb0158e191f0eadf4bec0645348cfb6e9619 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 27 Jul 2012 16:28:36 +0200 Subject: [PATCH] Ensure that QAtomicPointer of forward-declared classes works This is working, but let's just be sure by adding a testcase. Change-Id: I8c6b5ded0c7b6c90645dbf70a7ce6c1ba447a284 Reviewed-by: Stephen Kelly Reviewed-by: Jason McDonald --- .../qatomicpointer/tst_qatomicpointer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp index ee6460d35c..a09bbe535e 100644 --- a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp +++ b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp @@ -69,6 +69,7 @@ private slots: void fetchAndAdd(); void constAndVolatile(); + void forwardDeclared(); private: static void warningFreeHelper(); }; @@ -647,5 +648,21 @@ void tst_QAtomicPointer::constAndVolatile() constAndVolatile_helper(); } +struct ForwardDeclared; +struct ContainsForwardDeclared +{ + QAtomicPointer ptr; +}; + +void tst_QAtomicPointer::forwardDeclared() +{ + // this is just a compilation test + QAtomicPointer ptr; + ContainsForwardDeclared cfd; + Q_UNUSED(ptr); + Q_UNUSED(cfd); + QVERIFY(true); +} + QTEST_APPLESS_MAIN(tst_QAtomicPointer) #include "tst_qatomicpointer.moc"