From 3c628138f570f363009299be65c3992e293580e1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Aug 2020 18:17:44 +0200 Subject: [PATCH] Suppress bogus -Wnoexcept from gcc9 in wx/graphics.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to what looks like a bug, gcc 9.3.0 gives the following incomplete error message without it: include/wx/graphics.h:278:7: error: but ‘wxGraphicsGradientStop::wxGraphicsGradientStop(wxGraphicsGradientStop&&)’ does not throw; perhaps it should be declared ‘noexcept’ [-Werror=noexcept] (without any other diagnostics). --- include/wx/graphics.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/wx/graphics.h b/include/wx/graphics.h index be0bfcbccc..1320a22cf4 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -274,6 +274,12 @@ extern WXDLLIMPEXP_DATA_CORE(wxGraphicsMatrix) wxNullGraphicsMatrix; // and how they are spread out in a gradient // ---------------------------------------------------------------------------- +// gcc 9 gives a nonsensical warning about implicitly generated move ctor not +// throwing but not being noexcept, suppress it. +#if wxCHECK_GCC_VERSION(9, 1) && !wxCHECK_GCC_VERSION(10, 0) +wxGCC_WARNING_SUPPRESS(noexcept) +#endif + // Describes a single gradient stop. class wxGraphicsGradientStop { @@ -306,6 +312,10 @@ private: float m_pos; }; +#if wxCHECK_GCC_VERSION(9, 1) && !wxCHECK_GCC_VERSION(10, 0) +wxGCC_WARNING_RESTORE(noexcept) +#endif + // A collection of gradient stops ordered by their positions (from lowest to // highest). The first stop (index 0, position 0.0) is always the starting // colour and the last one (index GetCount() - 1, position 1.0) is the end