From c496fee2a5b65fd1b0672923293db058486e350e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 11 Oct 2019 14:10:39 -0700 Subject: qSwap: suppress pedantic warning about noexcept being false This warning is not in -Wall or -Wextra, but it happens in a single place, so we can reasonably suppress it. Fixes: QTBUG-79138 Change-Id: Ib5d667bf77a740c28d2efffd15ccb3f62cf8f431 Reviewed-by: Edward Welbourne Reviewed-by: Allan Sandfeld Jensen --- src/corelib/global/qglobal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index e335916eac..e636a7cf8f 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -944,6 +944,10 @@ QT_WARNING_POP # define Q_DUMMY_COMPARISON_OPERATOR(C) #endif +QT_WARNING_PUSH +// warning: noexcept-expression evaluates to ‘false’ because of a call to ‘void swap(..., ...)' +QT_WARNING_DISABLE_GCC("-Wnoexcept") + namespace QtPrivate { namespace SwapExceptionTester { // insulate users from the "using std::swap" below @@ -963,6 +967,8 @@ inline void qSwap(T &value1, T &value2) swap(value1, value2); } +QT_WARNING_POP + #if QT_DEPRECATED_SINCE(5, 0) Q_CORE_EXPORT QT_DEPRECATED void *qMalloc(size_t size) Q_ALLOC_SIZE(1); Q_CORE_EXPORT QT_DEPRECATED void qFree(void *ptr); -- cgit v1.2.3