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 <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
bb10
Thiago Macieira 2019-10-11 14:10:39 -07:00
parent 5a660353ed
commit c496fee2a5
1 changed files with 6 additions and 0 deletions

View File

@ -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);