diff --git a/include/wx/compositewin.h b/include/wx/compositewin.h index d9fad98d47..b6166fd67e 100644 --- a/include/wx/compositewin.h +++ b/include/wx/compositewin.h @@ -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 void SetForAllParts(R (wxWindowBase::*func)(TArg), T arg) {