From 5a1b4832a2704e7fb386d6b4c73dab85facdc40b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 10 Jan 2017 15:30:42 -0800 Subject: Adapt to the C++ SIC introduced by P0021: noexcept overloading C++17 adopts P0021R1[1], which makes noexcept be part of the function pointer's type and thus be overloadable. It contains some provisions for allowing a noexcept function pointer to cast implicitly to a non- noexcept function pointer, but that fails in the presence of templates and additional overloads that could match the type in question. Fortunately, the paper proposed a test macro, so we can change our sources now and be compatible with both C++14 and C++17 rules. This first failed with Clang 4.0 trunk. This source incompatibility is not our fault, it's the language's doing. [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html Task-number: QTBUG-58054 Change-Id: I2bc52f3c7a574209b213fffd14988cf0b875be63 Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp') diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index fe97695d19..29ff552f6a 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -766,6 +766,11 @@ class StaticEventLoop { public: static void quitEventLoop() + { + quitEventLoop_noexcept(); + } + + static void quitEventLoop_noexcept() Q_DECL_NOTHROW { QVERIFY(!_e.isNull()); _e->quit(); @@ -787,6 +792,9 @@ void tst_QTimer::singleShotToFunctors() QTimer::singleShot(0, &StaticEventLoop::quitEventLoop); QCOMPARE(_e->exec(), 0); + QTimer::singleShot(0, &StaticEventLoop::quitEventLoop_noexcept); + QCOMPARE(_e->exec(), 0); + QThread t1; QObject c1; c1.moveToThread(&t1); -- cgit v1.2.3