Suppress unavoidable -Wsuggest-override in wxCompositeWindow

This allows new wxMSW wxRadioBox implementation to use wxCompositeWindow
without triggering this warning due to the base wxStaticBox class
already inheriting from wxCompositeWindow too.
This commit is contained in:
Vadim Zeitlin 2022-12-25 01:14:49 +01:00
parent 9c38b12526
commit 58840fe7fd

View file

@ -132,10 +132,24 @@ protected:
}
private:
// It may happen that we the base class W already is a wxCompositeWindow
// and so already has GetCompositeWindowParts(). This actually works fine,
// as it just gets overridden by the most derived class, but triggers a
// warning, so disable this warning explicitly as we can't do anything else
// about it here (as actually using "override" here would result in an
// error for the first class in the hierarchy using wxCompositeWindow).
#if wxCHECK_GCC_VERSION(5,1)
wxGCC_ONLY_WARNING_SUPPRESS(suggest-override)
#endif
// Must be implemented by the derived class to return all children to which
// the public methods we override should forward to.
virtual wxWindowList GetCompositeWindowParts() const = 0;
#if wxCHECK_GCC_VERSION(5,1)
wxGCC_ONLY_WARNING_RESTORE(suggest-override)
#endif
template <class T, class TArg, class R>
void SetForAllParts(R (wxWindowBase::*func)(TArg), T arg)
{