Work around -Wuggest-override for event table macros from gcc 11
Disabling -Wsuggest-override inside macros is broken in gcc, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578, and has started affecting wxWARNING_SUPPRESS_MISSING_OVERRIDE since gcc 11, i.e. this macro doesn't have any effect any more and the warning is still given. Avoid it by actually specifying "override" for gcc 11 (as doing it for all compilers would result in -Winconsistent-missing-override from clang) and check that we don't get this warning in the allheaders test. Also don't use wxDECLARE_ABSTRACT_CLASS() inside wxObject itself, now that it uses "override", which is not appropriate for the base class version. This is arguably more clear and should have been done like this since the beginning anyhow.
This commit is contained in:
@@ -140,7 +140,7 @@ WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
|
||||
#define wxDECLARE_ABSTRACT_CLASS(name) \
|
||||
public: \
|
||||
wxWARNING_SUPPRESS_MISSING_OVERRIDE() \
|
||||
virtual wxClassInfo *GetClassInfo() const; \
|
||||
virtual wxClassInfo *GetClassInfo() const wxDUMMY_OVERRIDE; \
|
||||
wxWARNING_RESTORE_MISSING_OVERRIDE() \
|
||||
static wxClassInfo ms_classInfo
|
||||
|
||||
|
Reference in New Issue
Block a user